1 2add_definitions( 3 -D_NTSYSTEM_ 4 -DNASSERT) 5 6list(APPEND SOURCE 7 cmcheck.c 8 cminit.c 9 cmheal.c 10 cmindex.c 11 cmkeydel.c 12 cmname.c 13 cmse.c 14 cmvalue.c 15 hivebin.c 16 hivecell.c 17 hiveinit.c 18 hivesum.c 19 hivewrt.c 20 cmlib.h) 21 22if(CMAKE_CROSSCOMPILING) 23 # CMLIB for NT bootloader 24 add_library(blcmlib ${SOURCE}) 25 target_compile_definitions(blcmlib PRIVATE _BLDR_) 26 add_dependencies(blcmlib bugcodes xdk) 27 add_pch(blcmlib cmlib.h SOURCE) 28 29 # CMLIB for NT kernel 30 add_library(cmlib ${SOURCE}) 31 add_dependencies(cmlib bugcodes xdk) 32 add_pch(cmlib cmlib.h SOURCE) 33else() 34 # CMLIB for host-tools 35 add_definitions( 36 -D__NO_CTYPE_INLINES 37 -DCMLIB_HOST) 38 add_library(cmlibhost ${SOURCE}) 39 target_include_directories(cmlibhost INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 40 41 if(NOT MSVC) 42 target_compile_options(cmlibhost PRIVATE -fshort-wchar -Wno-multichar) 43 endif() 44 45 target_link_libraries(cmlibhost PRIVATE host_includes) 46endif() 47