[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/sqrtf.c
60 math/s_modf.c
61 math/sinf.c
62 math/sinh.c
63 math/tanh.c
64 math/pow_asm.c
65 mbstring/hanzen.c
66 mbstring/ischira.c
67 mbstring/iskana.c
68 mbstring/iskmoji.c
69 mbstring/iskpun.c
70 mbstring/islead.c
71 mbstring/islwr.c
72 mbstring/ismbal.c
73 mbstring/ismbaln.c
74 mbstring/ismbc.c
75 mbstring/ismbgra.c
76 mbstring/ismbkaln.c
77 mbstring/ismblead.c
78 mbstring/ismbpri.c
79 mbstring/ismbpun.c
80 mbstring/ismbtrl.c
81 mbstring/isuppr.c
82 mbstring/jistojms.c
83 mbstring/jmstojis.c
84 mbstring/mbbtype.c
85 mbstring/mbccpy.c
86 mbstring/mbclen.c
87 mbstring/mbscat.c
88 mbstring/mbschr.c
89 mbstring/mbscmp.c
90 mbstring/mbscoll.c
91 mbstring/mbscpy.c
92 mbstring/mbscspn.c
93 mbstring/mbsdec.c
94 mbstring/mbsdup.c
95 mbstring/mbsicmp.c
96 mbstring/mbsicoll.c
97 mbstring/mbsinc.c
98 mbstring/mbslen.c
99 mbstring/mbslwr.c
100 mbstring/mbsncat.c
101 mbstring/mbsnccnt.c
102 mbstring/mbsncmp.c
103 mbstring/mbsncoll.c
104 mbstring/mbsncpy.c
105 mbstring/mbsnextc.c
106 mbstring/mbsnicmp.c
107 mbstring/mbsnicoll.c
108 mbstring/mbsninc.c
109 mbstring/mbsnset.c
110 mbstring/mbspbrk.c
111 mbstring/mbsrchr.c
112 mbstring/mbsrev.c
113 mbstring/mbsset.c
114 mbstring/mbsspn.c
115 mbstring/mbsspnp.c
116 mbstring/mbsstr.c
117 mbstring/mbstok.c
118 mbstring/mbstrlen.c
119 mbstring/mbsupr.c
120 mem/memcmp.c
121 mem/memccpy.c
122 mem/memicmp.c
123 misc/amsg.c
124 misc/assert.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_asm.s
331 math/i386/ci.c
332 math/i386/exp_asm.s
333 math/i386/fmod_asm.s
334 math/i386/fmodf_asm.s
335 math/i386/ldexp.c
336 mem/i386/memchr_asm.s
337 mem/i386/memmove_asm.s
338 mem/i386/memset_asm.s
339 string/i386/strcat_asm.s
340 string/i386/strchr_asm.s
341 string/i386/strcmp_asm.s
342 string/i386/strcpy_asm.s
343 string/i386/strlen_asm.s
344 string/i386/strncat_asm.s
345 string/i386/strncmp_asm.s
346 string/i386/strncpy_asm.s
347 string/i386/strnlen_asm.s
348 string/i386/strrchr_asm.s
349 string/i386/wcscat_asm.s
350 string/i386/wcschr_asm.s
351 string/i386/wcscmp_asm.s
352 string/i386/wcscpy_asm.s
353 string/i386/wcslen_asm.s
354 string/i386/wcsncat_asm.s
355 string/i386/wcsncmp_asm.s
356 string/i386/wcsncpy_asm.s
357 string/i386/wcsnlen_asm.s
358 string/i386/wcsrchr_asm.s)
359 else()
360 list(APPEND CRT_SOURCE
361 math/stubs.c
362 mem/memchr.c
363 mem/memcpy.c
364 mem/memmove.c
365 mem/memset.c
366 string/strcat.c
367 string/strchr.c
368 string/strcmp.c
369 string/strcpy.c
370 string/strlen.c
371 string/strncat.c
372 string/strncmp.c
373 string/strncpy.c
374 string/strnlen.c
375 string/strrchr.c
376 string/wcscat.c
377 string/wcschr.c
378 string/wcscmp.c
379 string/wcscpy.c
380 string/wcslen.c
381 string/wcsncat.c
382 string/wcsncmp.c
383 string/wcsncpy.c
384 string/wcsnlen.c
385 string/wcsrchr.c)
386 endif(ARCH MATCHES i386)
387
388 if(ARCH MATCHES amd64)
389 list(APPEND CRT_SOURCE
390 math/cos.c
391 math/sin.c
392 math/amd64/alldiv.S
393 math/amd64/atan.S
394 math/amd64/atan2.S
395 math/amd64/ceil.S
396 math/amd64/ceilf.S
397 math/amd64/exp.S
398 math/amd64/fabs.S
399 math/amd64/floor.S
400 math/amd64/floorf.S
401 math/amd64/fmod.S
402 math/amd64/fmodf.S
403 math/amd64/ldexp.S
404 math/amd64/log.S
405 math/amd64/log10.S
406 math/amd64/pow.S
407 math/amd64/sqrt.S
408 math/amd64/sqrtf.S
409 math/amd64/tan.S)
410 endif(ARCH MATCHES amd64)
411
412 add_library(crt ${CMAKE_CURRENT_BINARY_DIR}/crt_precomp.h.gch ${CRT_SOURCE})
413
414 set_property(TARGET crt PROPERTY COMPILE_DEFINITIONS __MINGW_IMPORT=extern USE_MSVCRT_PREFIX _MSVCRT_LIB_ _MSVCRT_ _MT)
415 add_pch(crt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${CRT_SOURCE})
416 add_dependencies(crt psdk)
417
418 list(APPEND LIBCNTPR_SOURCE
419 except/${ARCH}/chkstk_asm.s
420 except/${ARCH}/seh.s
421 math/abs.c
422 math/div.c
423 math/labs.c
424 math/rand_nt.c
425 mem/memccpy.c
426 mem/memcmp.c
427 mem/memicmp.c
428 search/bsearch.c
429 search/lfind.c
430 setjmp/${ARCH}/setjmp.s
431 stdlib/qsort.c
432 string/ctype.c
433 string/scanf.c
434 string/strcspn.c
435 string/stricmp.c
436 string/strnicmp.c
437 string/strlwr.c
438 string/strrev.c
439 string/strset.c
440 string/strstr.c
441 string/strupr.c
442 string/strpbrk.c
443 string/strspn.c
444 string/atoi64.c
445 string/atoi.c
446 string/atol.c
447 string/itoa.c
448 string/itow.c
449 string/mbstowcs_nt.c
450 string/splitp.c
451 string/strtol.c
452 string/strtoul.c
453 string/strtoull.c
454 string/wcs.c
455 string/wcstol.c
456 string/wcstombs_nt.c
457 string/wcstoul.c
458 string/wsplitp.c
459 string/wtoi64.c
460 string/wtoi.c
461 string/wtol.c
462 wstring/wcsicmp.c
463 wstring/wcslwr.c
464 wstring/wcsnicmp.c
465 wstring/wcsupr.c
466 wstring/wcscspn.c
467 wstring/wcsspn.c
468 wstring/wcsstr.c)
469
470 if(ARCH MATCHES i386)
471 list(APPEND LIBCNTPR_SOURCE
472 math/i386/alldiv_asm.s
473 math/i386/alldvrm_asm.s
474 math/i386/allmul_asm.s
475 math/i386/allrem_asm.s
476 math/i386/allshl_asm.s
477 math/i386/allshr_asm.s
478 math/i386/atan_asm.s
479 math/i386/aulldiv_asm.s
480 math/i386/aulldvrm_asm.s
481 math/i386/aullrem_asm.s
482 math/i386/aullshr_asm.s
483 math/i386/ceil_asm.s
484 math/i386/cos_asm.s
485 math/i386/fabs_asm.s
486 math/i386/floor_asm.s
487 math/i386/ftol_asm.s
488 math/i386/log_asm.s
489 math/i386/pow_asm.s
490 math/i386/sin_asm.s
491 math/i386/sqrt_asm.s
492 math/i386/tan_asm.s
493 math/i386/ci.c)
494 elseif(ARCH MATCHES amd64)
495 list(APPEND LIBCNTPR_SOURCE
496 math/cos.c
497 math/sin.c
498 math/amd64/alldiv.S
499 math/amd64/atan.S
500 math/amd64/atan2.S
501 math/amd64/ceil.S
502 math/amd64/exp.S
503 math/amd64/fabs.S
504 math/amd64/floor.S
505 math/amd64/fmod.S
506 math/amd64/ldexp.S
507 math/amd64/log.S
508 math/amd64/log10.S
509 math/amd64/pow.S
510 math/amd64/sqrt.S
511 math/amd64/tan.S)
512 endif(ARCH MATCHES i386)
513
514 if(ARCH MATCHES i386)
515 list(APPEND LIBCNTPR_SOURCE
516 mem/i386/memchr_asm.s
517 mem/i386/memmove_asm.s
518 mem/i386/memset_asm.s
519 string/i386/strcat_asm.s
520 string/i386/strchr_asm.s
521 string/i386/strcmp_asm.s
522 string/i386/strcpy_asm.s
523 string/i386/strlen_asm.s
524 string/i386/strncat_asm.s
525 string/i386/strncmp_asm.s
526 string/i386/strncpy_asm.s
527 string/i386/strnlen_asm.s
528 string/i386/strrchr_asm.s
529 string/i386/wcscat_asm.s
530 string/i386/wcschr_asm.s
531 string/i386/wcscmp_asm.s
532 string/i386/wcscpy_asm.s
533 string/i386/wcslen_asm.s
534 string/i386/wcsncat_asm.s
535 string/i386/wcsncmp_asm.s
536 string/i386/wcsncpy_asm.s
537 string/i386/wcsnlen_asm.s
538 string/i386/wcsrchr_asm.s)
539 else()
540 list(APPEND LIBCNTPR_SOURCE
541 mem/memchr.c
542 mem/memcpy.c
543 mem/memmove.c
544 mem/memset.c
545 string/strcat.c
546 string/strchr.c
547 string/strcmp.c
548 string/strcpy.c
549 string/strlen.c
550 string/strncat.c
551 string/strncmp.c
552 string/strncpy.c
553 string/strnlen.c
554 string/strrchr.c
555 string/wcscat.c
556 string/wcschr.c
557 string/wcscmp.c
558 string/wcscpy.c
559 string/wcslen.c
560 string/wcsncat.c
561 string/wcsncmp.c
562 string/wcsncpy.c
563 string/wcsnlen.c
564 string/wcsrchr.c)
565 endif(ARCH MATCHES i386)
566
567 add_library(libcntpr ${LIBCNTPR_SOURCE})
568 set_property(TARGET libcntpr PROPERTY COMPILE_DEFINITIONS NO_RTL_INLINES _NTSYSTEM_ _NTDLLBUILD_ _LIBCNT_ __CRT__NO_INLINE)
569 add_dependencies(libcntpr psdk buildno_header ks386)