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