1 2include_directories(include) 3 4add_definitions(-D_CRTBLD) 5 6if(ARCH STREQUAL "i386") 7 list(APPEND CHKSTK_ASM_SOURCE except/i386/chkstk_asm.s) 8 if(NOT MSVC) 9 list(APPEND CHKSTK_SOURCE except/i386/chkstk_ms.s) 10 endif() 11elseif(ARCH STREQUAL "amd64") 12 list(APPEND CHKSTK_ASM_SOURCE except/amd64/chkstk_asm.s) 13 if(NOT MSVC) 14 list(APPEND CHKSTK_SOURCE except/amd64/chkstk_ms.s) 15 endif() 16elseif(ARCH STREQUAL "arm") 17 list(APPEND CHKSTK_ASM_SOURCE except/arm/chkstk_asm.s) 18 if(NOT MSVC) 19 list(APPEND CHKSTK_SOURCE except/arm/chkstk_ms.s) 20 endif() 21elseif(ARCH STREQUAL "powerpc") 22 list(APPEND CHKSTK_ASM_SOURCE except/powerpc/chkstk_asm.s) 23endif() 24 25add_asm_files(chkstk_lib_asm ${CHKSTK_ASM_SOURCE}) 26add_library(chkstk ${CHKSTK_SOURCE} ${chkstk_lib_asm}) 27set_target_properties(chkstk PROPERTIES LINKER_LANGUAGE "C") 28add_dependencies(chkstk asm) 29 30include(crt.cmake) 31include(libcntpr.cmake) 32include(msvcrtex.cmake) 33include(oldnames.cmake) 34 35add_library(user32_wsprintf 36 printf/streamout.c 37 printf/wstreamout.c 38 printf/wsprintfA.c 39 printf/wsprintfW.c 40 printf/wvsprintfA.c 41 printf/wvsprintfW.c 42 printf/wvsnprintfA.c 43 printf/wvsnprintfW.c 44 string/strnlen.c 45 string/wcsnlen.c 46 string/mbstowcs_nt.c 47 string/wcstombs_nt.c) 48 49add_dependencies(user32_wsprintf psdk) 50target_compile_definitions(user32_wsprintf PRIVATE _USER32_WSPRINTF) 51 52add_library(memcmp mem/memcmp.c) 53add_dependencies(memcmp psdk) 54 55add_library(getopt misc/getopt.c) 56target_compile_definitions(getopt PRIVATE _DLL __USE_CRTIMP) 57add_dependencies(getopt psdk) 58 59add_library(strtol 60 string/ctype.c 61 string/iswctype.c 62 string/strtoi64.c 63 string/strtol.c 64 string/strtoul.c 65 string/strtoull.c 66 string/wctype.c) 67target_compile_definitions(strtol PRIVATE _LIBCNT_) 68add_dependencies(strtol psdk) 69 70 71if(ARCH STREQUAL "i386") 72 list(APPEND ATAN2_ASM_SOURCE math/i386/atan2_asm.s) 73elseif(ARCH STREQUAL "amd64") 74 list(APPEND ATAN2_ASM_SOURCE math/amd64/atan2.S) 75elseif(ARCH STREQUAL "arm") 76 list(APPEND ATAN2_ASM_SOURCE math/arm/atan2.s) 77endif() 78 79add_asm_files(atan2_asm ${ATAN2_ASM_SOURCE}) 80add_library(atan2 ${atan2_asm}) 81set_target_properties(atan2 PROPERTIES LINKER_LANGUAGE "C") 82add_dependencies(atan2 asm) 83 84 85