1fb3abe2f8ac29c5ebb5217fee3e2c0b7917c1a2
[reactos.git] / lib / sdk / crt / CMakeLists.txt
1
2 include_directories(.)
3 include_directories(./include)
4
5 add_definitions(-D_CRTBLD)
6
7 file(GLOB_RECURSE CRT_SOURCE "*.c")
8 LIST(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/stdio/findgen.c)
9 LIST(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strtold.c)
10
11 add_library(crt ${CRT_SOURCE})
12 set_property(TARGET crt PROPERTY COMPILE_DEFINITIONS -D__MINGW_IMPORT=extern -DUSE_MSVCRT_PREFIX -D_MSVCRT_LIB_ -D_MSVCRT_ -D_MT)
13 add_dependencies(crt psdk)
14
15 get_directory_property(defines COMPILE_DEFINITIONS)
16
17 foreach(arg ${defines})
18 set(result_defs "${result_defs} -D${arg}")
19 endforeach(arg ${defines})
20
21 set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> ${result_defs} -D__ASM__ <FLAGS> -c <SOURCE>")
22
23 if(ARCH MATCHES i386)
24 set(LIBCNTPR_SOURCE
25 ${CMAKE_CURRENT_SOURCE_DIR}/except/i386/chkstk_asm.s
26 ${CMAKE_CURRENT_SOURCE_DIR}/except/i386/seh.s
27 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/alldiv_asm.s
28 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/alldvrm_asm.s
29 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/allmul_asm.s
30 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/allrem_asm.s
31 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/allshl_asm.s
32 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/allshr_asm.s
33 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/atan_asm.s
34 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/aulldiv_asm.s
35 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/aulldvrm_asm.s
36 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/aullrem_asm.s
37 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/aullshr_asm.s
38 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/ceil_asm.s
39 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/cos_asm.s
40 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/fabs_asm.s
41 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/floor_asm.s
42 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/ftol_asm.s
43 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/log_asm.s
44 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/pow_asm.s
45 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/sin_asm.s
46 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/sqrt_asm.s
47 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/tan_asm.s
48 ${CMAKE_CURRENT_SOURCE_DIR}/math/i386/ci.c
49 ${CMAKE_CURRENT_SOURCE_DIR}/math/abs.c
50 ${CMAKE_CURRENT_SOURCE_DIR}/math/div.c
51 ${CMAKE_CURRENT_SOURCE_DIR}/math/labs.c
52 ${CMAKE_CURRENT_SOURCE_DIR}/math/rand_nt.c
53 ${CMAKE_CURRENT_SOURCE_DIR}/mem/i386/memchr_asm.s
54 ${CMAKE_CURRENT_SOURCE_DIR}/mem/i386/memcpy_asm.s
55 ${CMAKE_CURRENT_SOURCE_DIR}/mem/i386/memmove_asm.s
56 ${CMAKE_CURRENT_SOURCE_DIR}/mem/i386/memset_asm.s
57 ${CMAKE_CURRENT_SOURCE_DIR}/mem/memccpy.c
58 ${CMAKE_CURRENT_SOURCE_DIR}/mem/memcmp.c
59 ${CMAKE_CURRENT_SOURCE_DIR}/mem/memicmp.c
60 ${CMAKE_CURRENT_SOURCE_DIR}/search/bsearch.c
61 ${CMAKE_CURRENT_SOURCE_DIR}/search/lfind.c
62 ${CMAKE_CURRENT_SOURCE_DIR}/setjmp/i386/setjmp.s
63 ${CMAKE_CURRENT_SOURCE_DIR}/stdlib/qsort.c
64 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strcat_asm.s
65 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strchr_asm.s
66 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strcmp_asm.s
67 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strcpy_asm.s
68 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strlen_asm.s
69 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strncat_asm.s
70 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strncmp_asm.s
71 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strncpy_asm.s
72 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strnlen_asm.s
73 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/strrchr_asm.s
74 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcscat_asm.s
75 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcschr_asm.s
76 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcscmp_asm.s
77 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcscpy_asm.s
78 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcslen_asm.s
79 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcsncat_asm.s
80 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcsncmp_asm.s
81 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcsncpy_asm.s
82 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcsnlen_asm.s
83 ${CMAKE_CURRENT_SOURCE_DIR}/string/i386/wcsrchr_asm.s
84 ${CMAKE_CURRENT_SOURCE_DIR}/string/ctype.c
85 ${CMAKE_CURRENT_SOURCE_DIR}/string/scanf.c
86 ${CMAKE_CURRENT_SOURCE_DIR}/string/strcspn.c
87 ${CMAKE_CURRENT_SOURCE_DIR}/string/stricmp.c
88 ${CMAKE_CURRENT_SOURCE_DIR}/string/strnicmp.c
89 ${CMAKE_CURRENT_SOURCE_DIR}/string/strlwr.c
90 ${CMAKE_CURRENT_SOURCE_DIR}/string/strrev.c
91 ${CMAKE_CURRENT_SOURCE_DIR}/string/strset.c
92 ${CMAKE_CURRENT_SOURCE_DIR}/string/strstr.c
93 ${CMAKE_CURRENT_SOURCE_DIR}/string/strupr.c
94 ${CMAKE_CURRENT_SOURCE_DIR}/string/strpbrk.c
95 ${CMAKE_CURRENT_SOURCE_DIR}/string/strspn.c
96 ${CMAKE_CURRENT_SOURCE_DIR}/string/atoi64.c
97 ${CMAKE_CURRENT_SOURCE_DIR}/string/atoi.c
98 ${CMAKE_CURRENT_SOURCE_DIR}/string/atol.c
99 ${CMAKE_CURRENT_SOURCE_DIR}/string/itoa.c
100 ${CMAKE_CURRENT_SOURCE_DIR}/string/itow.c
101 ${CMAKE_CURRENT_SOURCE_DIR}/string/mbstowcs_nt.c
102 ${CMAKE_CURRENT_SOURCE_DIR}/string/splitp.c
103 ${CMAKE_CURRENT_SOURCE_DIR}/string/strtol.c
104 ${CMAKE_CURRENT_SOURCE_DIR}/string/strtoul.c
105 ${CMAKE_CURRENT_SOURCE_DIR}/string/strtoull.c
106 ${CMAKE_CURRENT_SOURCE_DIR}/string/wcs.c
107 ${CMAKE_CURRENT_SOURCE_DIR}/string/wcstol.c
108 ${CMAKE_CURRENT_SOURCE_DIR}/string/wcstombs_nt.c
109 ${CMAKE_CURRENT_SOURCE_DIR}/string/wcstoul.c
110 ${CMAKE_CURRENT_SOURCE_DIR}/string/wsplitp.c
111 ${CMAKE_CURRENT_SOURCE_DIR}/string/wtoi64.c
112 ${CMAKE_CURRENT_SOURCE_DIR}/string/wtoi.c
113 ${CMAKE_CURRENT_SOURCE_DIR}/string/wtol.c
114 ${CMAKE_CURRENT_SOURCE_DIR}/wstring/wcsicmp.c
115 ${CMAKE_CURRENT_SOURCE_DIR}/wstring/wcslwr.c
116 ${CMAKE_CURRENT_SOURCE_DIR}/wstring/wcsnicmp.c
117 ${CMAKE_CURRENT_SOURCE_DIR}/wstring/wcsupr.c
118 ${CMAKE_CURRENT_SOURCE_DIR}/wstring/wcscspn.c
119 ${CMAKE_CURRENT_SOURCE_DIR}/wstring/wcsspn.c
120 ${CMAKE_CURRENT_SOURCE_DIR}/wstring/wcsstr.c
121 )
122 else()
123 #TBD
124 endif()
125
126 add_library(libcntpr ${LIBCNTPR_SOURCE})
127
128 set_property(TARGET libcntpr PROPERTY COMPILE_DEFINITIONS NO_RTL_INLINES _NTSYSTEM_ _NTDLLBUILD_ _LIBCNT_ __CRT__NO_INLINE)
129
130 add_dependencies(libcntpr psdk)