[CMAKE]
[reactos.git] / lib / sdk / crt / CMakeLists.txt
1
2 include_directories(include)
3
4 add_definitions(-D_CRTBLD)
5
6 list(APPEND CRT_SOURCE
7 conio/cgets.c
8 conio/cprintf.c
9 conio/cputs.c
10 conio/getch.c
11 conio/getche.c
12 conio/kbhit.c
13 conio/putch.c
14 conio/ungetch.c
15 direct/chdir.c
16 direct/chdrive.c
17 direct/getcwd.c
18 direct/getdcwd.c
19 direct/getdfree.c
20 direct/getdrive.c
21 direct/mkdir.c
22 direct/rmdir.c
23 direct/wchdir.c
24 direct/wgetcwd.c
25 direct/wgetdcwd.c
26 direct/wmkdir.c
27 direct/wrmdir.c
28 except/abnorter.c
29 except/checkesp.c
30 except/cpp.c
31 except/cppexcept.c
32 except/except.c
33 except/matherr.c
34 except/${ARCH}/seh.s
35 except/xcptfil.c
36 float/chgsign.c
37 float/copysign.c
38 float/fpclass.c
39 float/fpecode.c
40 float/isnan.c
41 float/nafter.c
42 float/scalb.c
43 locale/locale.c
44 math/acos.c
45 math/adjust.c
46 math/asin.c
47 math/cabs.c
48 math/cosf.c
49 math/cosh.c
50 math/div.c
51 math/fdivbug.c
52 math/frexp.c
53 math/huge_val.c
54 math/hypot.c
55 math/ldiv.c
56 math/logf.c
57 math/modf.c
58 math/rand.c
59 math/s_modf.c
60 math/sinf.c
61 math/sinh.c
62 math/tanh.c
63 math/pow_asm.c
64 mbstring/hanzen.c
65 mbstring/ischira.c
66 mbstring/iskana.c
67 mbstring/iskmoji.c
68 mbstring/iskpun.c
69 mbstring/islead.c
70 mbstring/islwr.c
71 mbstring/ismbal.c
72 mbstring/ismbaln.c
73 mbstring/ismbc.c
74 mbstring/ismbgra.c
75 mbstring/ismbkaln.c
76 mbstring/ismblead.c
77 mbstring/ismbpri.c
78 mbstring/ismbpun.c
79 mbstring/ismbtrl.c
80 mbstring/isuppr.c
81 mbstring/jistojms.c
82 mbstring/jmstojis.c
83 mbstring/mbbtype.c
84 mbstring/mbccpy.c
85 mbstring/mbclen.c
86 mbstring/mbscat.c
87 mbstring/mbschr.c
88 mbstring/mbscmp.c
89 mbstring/mbscoll.c
90 mbstring/mbscpy.c
91 mbstring/mbscspn.c
92 mbstring/mbsdec.c
93 mbstring/mbsdup.c
94 mbstring/mbsicmp.c
95 mbstring/mbsicoll.c
96 mbstring/mbsinc.c
97 mbstring/mbslen.c
98 mbstring/mbslwr.c
99 mbstring/mbsncat.c
100 mbstring/mbsnccnt.c
101 mbstring/mbsncmp.c
102 mbstring/mbsncoll.c
103 mbstring/mbsncpy.c
104 mbstring/mbsnextc.c
105 mbstring/mbsnicmp.c
106 mbstring/mbsnicoll.c
107 mbstring/mbsninc.c
108 mbstring/mbsnset.c
109 mbstring/mbspbrk.c
110 mbstring/mbsrchr.c
111 mbstring/mbsrev.c
112 mbstring/mbsset.c
113 mbstring/mbsspn.c
114 mbstring/mbsspnp.c
115 mbstring/mbsstr.c
116 mbstring/mbstok.c
117 mbstring/mbstrlen.c
118 mbstring/mbsupr.c
119 mem/memcmp.c
120 mem/memccpy.c
121 mem/memicmp.c
122 misc/amsg.c
123 misc/assert.c
124 misc/crtmain.c
125 misc/environ.c
126 misc/getargs.c
127 misc/initterm.c
128 misc/lock.c
129 misc/purecall.c
130 misc/stubs.c
131 misc/tls.c
132 process/_cwait.c
133 process/_system.c
134 process/dll.c
135 process/process.c
136 process/procid.c
137 process/thread.c
138 process/threadid.c
139 process/threadx.c
140 process/wprocess.c
141 search/bsearch.c
142 search/lfind.c
143 search/lsearch.c
144 setjmp/${ARCH}/setjmp.s
145 signal/signal.c
146 signal/xcptinfo.c
147 stdio/access.c
148 stdio/file.c
149 stdio/find.c
150 stdio/find64.c
151 stdio/findi64.c
152 stdio/fmode.c
153 stdio/lnx_sprintf.c
154 stdio/perror.c
155 stdio/popen.c
156 stdio/stat.c
157 stdio/stat64.c
158 stdio/waccess.c
159 stdio/wfind.c
160 stdio/wfind64.c
161 stdio/wfindi64.c
162 stdio/wpopen.c
163 stdio/wstat.c
164 stdio/wstat64.c
165 stdlib/_exit.c
166 stdlib/abort.c
167 stdlib/atexit.c
168 stdlib/ecvt.c
169 stdlib/errno.c
170 stdlib/fcvt.c
171 stdlib/fcvtbuf.c
172 stdlib/fullpath.c
173 stdlib/gcvt.c
174 stdlib/getenv.c
175 stdlib/makepath.c
176 stdlib/makepath_s.c
177 stdlib/mbtowc.c
178 stdlib/mbstowcs.c
179 stdlib/obsol.c
180 stdlib/putenv.c
181 stdlib/qsort.c
182 stdlib/rot.c
183 stdlib/senv.c
184 stdlib/swab.c
185 stdlib/wfulpath.c
186 stdlib/wputenv.c
187 stdlib/wsenv.c
188 stdlib/wmakpath.c
189 stdlib/wmakpath_s.c
190 string/atof.c
191 string/atoi.c
192 string/atoi64.c
193 string/atol.c
194 string/ctype.c
195 string/itoa.c
196 string/itow.c
197 string/lasttok.c
198 string/scanf.c
199 string/splitp.c
200 string/strcoll.c
201 string/strcspn.c
202 string/strdup.c
203 string/strerror.c
204 string/stricmp.c
205 string/string.c
206 string/strlwr.c
207 string/strncoll.c
208 string/strnicmp.c
209 string/strpbrk.c
210 string/strrev.c
211 string/strset.c
212 string/strspn.c
213 string/strstr.c
214 string/strtod.c
215 string/strtoi64.c
216 string/strtok.c
217 string/strtol.c
218 string/strtoul.c
219 string/strtoull.c
220 string/strupr.c
221 string/strxfrm.c
222 string/wcs.c
223 string/wcstol.c
224 string/wcstoul.c
225 string/wsplitp.c
226 string/wtoi.c
227 string/wtoi64.c
228 string/wtol.c
229 sys_stat/systime.c
230 time/asctime.c
231 time/clock.c
232 time/ctime32.c
233 time/ctime64.c
234 time/ctime.c
235 time/difftime32.c
236 time/difftime64.c
237 time/difftime.c
238 time/ftime32.c
239 time/ftime64.c
240 time/ftime.c
241 time/futime32.c
242 time/futime64.c
243 time/futime.c
244 time/gmtime.c
245 time/localtime32.c
246 time/localtime64.c
247 time/localtime.c
248 time/mktime.c
249 time/strdate.c
250 time/strftime.c
251 time/strtime.c
252 time/time32.c
253 time/time64.c
254 time/time.c
255 time/timezone.c
256 time/tzname.c
257 time/utime32.c
258 time/utime64.c
259 time/utime.c
260 time/wasctime.c
261 time/wcsftime.c
262 time/wctime32.c
263 time/wctime64.c
264 time/wctime.c
265 time/wstrdate.c
266 time/wstrtime.c
267 time/wutime32.c
268 time/wutime64.c
269 time/wutime.c
270 wstring/wcscoll.c
271 wstring/wcscspn.c
272 wstring/wcsicmp.c
273 wstring/wcslwr.c
274 wstring/wcsnicmp.c
275 wstring/wcsspn.c
276 wstring/wcsstr.c
277 wstring/wcstok.c
278 wstring/wcsupr.c
279 wstring/wcsxfrm.c
280 wstring/wlasttok.c
281 wine/heap.c
282 wine/undname.c)
283
284 if(ARCH MATCHES i386)
285 list(APPEND CRT_SOURCE
286 except/i386/chkstk_asm.s
287 except/i386/prolog.s
288 except/i386/unwind.c
289 float/i386/clearfp.c
290 float/i386/cntrlfp.c
291 float/i386/fpreset.c
292 float/i386/logb.c
293 float/i386/statfp.c)
294 elseif(ARCH MATCHES amd64)
295 list(APPEND CRT_SOURCE
296 except/amd64/chkstk_asm.s
297 float/i386/clearfp.c
298 float/i386/cntrlfp.c
299 float/i386/fpreset.c
300 float/i386/logb.c
301 float/i386/statfp.c)
302 endif(ARCH MATCHES i386)
303
304 if(ARCH MATCHES i386)
305 list(APPEND CRT_SOURCE
306 math/i386/alldiv_asm.s
307 math/i386/alldvrm_asm.s
308 math/i386/allmul_asm.s
309 math/i386/allrem_asm.s
310 math/i386/allshl_asm.s
311 math/i386/allshr_asm.s
312 math/i386/atan_asm.s
313 math/i386/aulldiv_asm.s
314 math/i386/aulldvrm_asm.s
315 math/i386/aullrem_asm.s
316 math/i386/aullshr_asm.s
317 math/i386/ceil_asm.s
318 math/i386/ceilf.S
319 math/i386/cos_asm.s
320 math/i386/fabs_asm.s
321 math/i386/floor_asm.s
322 math/i386/floorf.S
323 math/i386/ftol_asm.s
324 math/i386/log_asm.s
325 math/i386/log10_asm.s
326 math/i386/pow_asm.s
327 math/i386/sin_asm.s
328 math/i386/sqrt_asm.s
329 math/i386/tan_asm.s
330 math/i386/atan2.c
331 math/i386/ci.c
332 math/i386/exp.c
333 math/i386/fmod.c
334 math/i386/fmodf.c
335 math/i386/ldexp.c
336 math/i386/sqrtf.c
337 mem/i386/memchr_asm.s
338 mem/i386/memcpy_asm.s
339 mem/i386/memmove_asm.s
340 mem/i386/memset_asm.s
341 string/i386/strcat_asm.s
342 string/i386/strchr_asm.s
343 string/i386/strcmp_asm.s
344 string/i386/strcpy_asm.s
345 string/i386/strlen_asm.s
346 string/i386/strncat_asm.s
347 string/i386/strncmp_asm.s
348 string/i386/strncpy_asm.s
349 string/i386/strnlen_asm.s
350 string/i386/strrchr_asm.s
351 string/i386/wcscat_asm.s
352 string/i386/wcschr_asm.s
353 string/i386/wcscmp_asm.s
354 string/i386/wcscpy_asm.s
355 string/i386/wcslen_asm.s
356 string/i386/wcsncat_asm.s
357 string/i386/wcsncmp_asm.s
358 string/i386/wcsncpy_asm.s
359 string/i386/wcsnlen_asm.s
360 string/i386/wcsrchr_asm.s)
361 else()
362 list(APPEND CRT_SOURCE
363 math/stubs.c
364 mem/memchr.c
365 mem/memcpy.c
366 mem/memmove.c
367 mem/memset.c
368 string/strcat.c
369 string/strchr.c
370 string/strcmp.c
371 string/strcpy.c
372 string/strlen.c
373 string/strncat.c
374 string/strncmp.c
375 string/strncpy.c
376 string/strnlen.c
377 string/strrchr.c
378 string/wcscat.c
379 string/wcschr.c
380 string/wcscmp.c
381 string/wcscpy.c
382 string/wcslen.c
383 string/wcsncat.c
384 string/wcsncmp.c
385 string/wcsncpy.c
386 string/wcsnlen.c
387 string/wcsrchr.c)
388 endif(ARCH MATCHES i386)
389
390 if(ARCH MATCHES amd64)
391 list(APPEND CRT_SOURCE
392 math/cos.c
393 math/sin.c
394 math/amd64/alldiv.S
395 math/amd64/atan.S
396 math/amd64/atan2.S
397 math/amd64/ceil.S
398 math/amd64/ceilf.S
399 math/amd64/exp.S
400 math/amd64/fabs.S
401 math/amd64/floor.S
402 math/amd64/floorf.S
403 math/amd64/fmod.S
404 math/amd64/fmodf.S
405 math/amd64/ldexp.S
406 math/amd64/log.S
407 math/amd64/log10.S
408 math/amd64/pow.S
409 math/amd64/sqrt.S
410 math/amd64/sqrtf.S
411 math/amd64/tan.S)
412 endif(ARCH MATCHES amd64)
413
414 add_library(crt ${CRT_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/crt_precomp.h.gch)
415
416 set_property(TARGET crt PROPERTY COMPILE_DEFINITIONS __MINGW_IMPORT=extern USE_MSVCRT_PREFIX _MSVCRT_LIB_ _MSVCRT_ _MT)
417 add_pch(crt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${CRT_SOURCE})
418 add_dependencies(crt psdk)
419
420 list(APPEND LIBCNTPR_SOURCE
421 except/${ARCH}/chkstk_asm.s
422 except/${ARCH}/seh.s
423 math/abs.c
424 math/div.c
425 math/labs.c
426 math/rand_nt.c
427 mem/memccpy.c
428 mem/memcmp.c
429 mem/memicmp.c
430 search/bsearch.c
431 search/lfind.c
432 setjmp/${ARCH}/setjmp.s
433 stdlib/qsort.c
434 string/ctype.c
435 string/scanf.c
436 string/strcspn.c
437 string/stricmp.c
438 string/strnicmp.c
439 string/strlwr.c
440 string/strrev.c
441 string/strset.c
442 string/strstr.c
443 string/strupr.c
444 string/strpbrk.c
445 string/strspn.c
446 string/atoi64.c
447 string/atoi.c
448 string/atol.c
449 string/itoa.c
450 string/itow.c
451 string/mbstowcs_nt.c
452 string/splitp.c
453 string/strtol.c
454 string/strtoul.c
455 string/strtoull.c
456 string/wcs.c
457 string/wcstol.c
458 string/wcstombs_nt.c
459 string/wcstoul.c
460 string/wsplitp.c
461 string/wtoi64.c
462 string/wtoi.c
463 string/wtol.c
464 wstring/wcsicmp.c
465 wstring/wcslwr.c
466 wstring/wcsnicmp.c
467 wstring/wcsupr.c
468 wstring/wcscspn.c
469 wstring/wcsspn.c
470 wstring/wcsstr.c)
471
472 if(ARCH MATCHES i386)
473 list(APPEND LIBCNTPR_SOURCE
474 math/i386/alldiv_asm.s
475 math/i386/alldvrm_asm.s
476 math/i386/allmul_asm.s
477 math/i386/allrem_asm.s
478 math/i386/allshl_asm.s
479 math/i386/allshr_asm.s
480 math/i386/atan_asm.s
481 math/i386/aulldiv_asm.s
482 math/i386/aulldvrm_asm.s
483 math/i386/aullrem_asm.s
484 math/i386/aullshr_asm.s
485 math/i386/ceil_asm.s
486 math/i386/cos_asm.s
487 math/i386/fabs_asm.s
488 math/i386/floor_asm.s
489 math/i386/ftol_asm.s
490 math/i386/log_asm.s
491 math/i386/pow_asm.s
492 math/i386/sin_asm.s
493 math/i386/sqrt_asm.s
494 math/i386/tan_asm.s
495 math/i386/ci.c)
496 elseif(ARCH MATCHES amd64)
497 list(APPEND LIBCNTPR_SOURCE
498 math/cos.c
499 math/sin.c
500 math/amd64/alldiv.S
501 math/amd64/atan.S
502 math/amd64/atan2.S
503 math/amd64/ceil.S
504 math/amd64/exp.S
505 math/amd64/fabs.S
506 math/amd64/floor.S
507 math/amd64/fmod.S
508 math/amd64/ldexp.S
509 math/amd64/log.S
510 math/amd64/log10.S
511 math/amd64/pow.S
512 math/amd64/sqrt.S
513 math/amd64/tan.S)
514 endif(ARCH MATCHES i386)
515
516 if(ARCH MATCHES i386)
517 list(APPEND LIBCNTPR_SOURCE
518 mem/i386/memchr_asm.s
519 mem/i386/memcpy_asm.s
520 mem/i386/memmove_asm.s
521 mem/i386/memset_asm.s
522 string/i386/strcat_asm.s
523 string/i386/strchr_asm.s
524 string/i386/strcmp_asm.s
525 string/i386/strcpy_asm.s
526 string/i386/strlen_asm.s
527 string/i386/strncat_asm.s
528 string/i386/strncmp_asm.s
529 string/i386/strncpy_asm.s
530 string/i386/strnlen_asm.s
531 string/i386/strrchr_asm.s
532 string/i386/wcscat_asm.s
533 string/i386/wcschr_asm.s
534 string/i386/wcscmp_asm.s
535 string/i386/wcscpy_asm.s
536 string/i386/wcslen_asm.s
537 string/i386/wcsncat_asm.s
538 string/i386/wcsncmp_asm.s
539 string/i386/wcsncpy_asm.s
540 string/i386/wcsnlen_asm.s
541 string/i386/wcsrchr_asm.s)
542 else()
543 list(APPEND LIBCNTPR_SOURCE
544 mem/memchr.c
545 mem/memcpy.c
546 mem/memmove.c
547 mem/memset.c
548 string/strcat.c
549 string/strchr.c
550 string/strcmp.c
551 string/strcpy.c
552 string/strlen.c
553 string/strncat.c
554 string/strncmp.c
555 string/strncpy.c
556 string/strnlen.c
557 string/strrchr.c
558 string/wcscat.c
559 string/wcschr.c
560 string/wcscmp.c
561 string/wcscpy.c
562 string/wcslen.c
563 string/wcsncat.c
564 string/wcsncmp.c
565 string/wcsncpy.c
566 string/wcsnlen.c
567 string/wcsrchr.c)
568 endif(ARCH MATCHES i386)
569
570 add_library(libcntpr ${LIBCNTPR_SOURCE})
571 set_property(TARGET libcntpr PROPERTY COMPILE_DEFINITIONS NO_RTL_INLINES _NTSYSTEM_ _NTDLLBUILD_ _LIBCNT_ __CRT__NO_INLINE)
572 add_dependencies(libcntpr psdk buildno_header)