c55991d602fe51454ea47e7f2da594148c24a763
[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 misc/i386/readcr4.S
340 string/i386/strcat_asm.s
341 string/i386/strchr_asm.s
342 string/i386/strcmp_asm.s
343 string/i386/strcpy_asm.s
344 string/i386/strlen_asm.s
345 string/i386/strncat_asm.s
346 string/i386/strncmp_asm.s
347 string/i386/strncpy_asm.s
348 string/i386/strnlen_asm.s
349 string/i386/strrchr_asm.s
350 string/i386/wcscat_asm.s
351 string/i386/wcschr_asm.s
352 string/i386/wcscmp_asm.s
353 string/i386/wcscpy_asm.s
354 string/i386/wcslen_asm.s
355 string/i386/wcsncat_asm.s
356 string/i386/wcsncmp_asm.s
357 string/i386/wcsncpy_asm.s
358 string/i386/wcsnlen_asm.s
359 string/i386/wcsrchr_asm.s)
360 else()
361 list(APPEND CRT_SOURCE
362 math/stubs.c
363 mem/memchr.c
364 mem/memcpy.c
365 mem/memmove.c
366 mem/memset.c
367 string/strcat.c
368 string/strchr.c
369 string/strcmp.c
370 string/strcpy.c
371 string/strlen.c
372 string/strncat.c
373 string/strncmp.c
374 string/strncpy.c
375 string/strnlen.c
376 string/strrchr.c
377 string/wcscat.c
378 string/wcschr.c
379 string/wcscmp.c
380 string/wcscpy.c
381 string/wcslen.c
382 string/wcsncat.c
383 string/wcsncmp.c
384 string/wcsncpy.c
385 string/wcsnlen.c
386 string/wcsrchr.c)
387 endif(ARCH MATCHES i386)
388
389 if(ARCH MATCHES amd64)
390 list(APPEND CRT_SOURCE
391 math/cos.c
392 math/sin.c
393 math/amd64/alldiv.S
394 math/amd64/atan.S
395 math/amd64/atan2.S
396 math/amd64/ceil.S
397 math/amd64/ceilf.S
398 math/amd64/exp.S
399 math/amd64/fabs.S
400 math/amd64/floor.S
401 math/amd64/floorf.S
402 math/amd64/fmod.S
403 math/amd64/fmodf.S
404 math/amd64/ldexp.S
405 math/amd64/log.S
406 math/amd64/log10.S
407 math/amd64/pow.S
408 math/amd64/sqrt.S
409 math/amd64/sqrtf.S
410 math/amd64/tan.S)
411 endif(ARCH MATCHES amd64)
412
413 add_library(crt ${CMAKE_CURRENT_BINARY_DIR}/crt_precomp.h.gch ${CRT_SOURCE})
414
415 set_property(TARGET crt PROPERTY COMPILE_DEFINITIONS __MINGW_IMPORT=extern USE_MSVCRT_PREFIX _MSVCRT_LIB_ _MSVCRT_ _MT)
416 add_pch(crt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${CRT_SOURCE})
417 add_dependencies(crt psdk buildno_header asm)
418
419 list(APPEND LIBCNTPR_SOURCE
420 except/${ARCH}/chkstk_asm.s
421 except/${ARCH}/seh.s
422 math/abs.c
423 math/div.c
424 math/labs.c
425 math/rand_nt.c
426 mem/memccpy.c
427 mem/memcmp.c
428 mem/memicmp.c
429 search/bsearch.c
430 search/lfind.c
431 setjmp/${ARCH}/setjmp.s
432 stdlib/qsort.c
433 string/ctype.c
434 string/scanf.c
435 string/strcspn.c
436 string/stricmp.c
437 string/strnicmp.c
438 string/strlwr.c
439 string/strrev.c
440 string/strset.c
441 string/strstr.c
442 string/strupr.c
443 string/strpbrk.c
444 string/strspn.c
445 string/atoi64.c
446 string/atoi.c
447 string/atol.c
448 string/itoa.c
449 string/itow.c
450 string/mbstowcs_nt.c
451 string/splitp.c
452 string/strtol.c
453 string/strtoul.c
454 string/strtoull.c
455 string/wcs.c
456 string/wcstol.c
457 string/wcstombs_nt.c
458 string/wcstoul.c
459 string/wsplitp.c
460 string/wtoi64.c
461 string/wtoi.c
462 string/wtol.c
463 wstring/wcsicmp.c
464 wstring/wcslwr.c
465 wstring/wcsnicmp.c
466 wstring/wcsupr.c
467 wstring/wcscspn.c
468 wstring/wcsspn.c
469 wstring/wcsstr.c)
470
471 if(ARCH MATCHES i386)
472 list(APPEND LIBCNTPR_SOURCE
473 math/i386/alldiv_asm.s
474 math/i386/alldvrm_asm.s
475 math/i386/allmul_asm.s
476 math/i386/allrem_asm.s
477 math/i386/allshl_asm.s
478 math/i386/allshr_asm.s
479 math/i386/atan_asm.s
480 math/i386/aulldiv_asm.s
481 math/i386/aulldvrm_asm.s
482 math/i386/aullrem_asm.s
483 math/i386/aullshr_asm.s
484 math/i386/ceil_asm.s
485 math/i386/cos_asm.s
486 math/i386/fabs_asm.s
487 math/i386/floor_asm.s
488 math/i386/ftol_asm.s
489 math/i386/ftol2_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 misc/i386/readcr4.S)
497 elseif(ARCH MATCHES amd64)
498 list(APPEND LIBCNTPR_SOURCE
499 math/cos.c
500 math/sin.c
501 math/amd64/alldiv.S
502 math/amd64/atan.S
503 math/amd64/atan2.S
504 math/amd64/ceil.S
505 math/amd64/exp.S
506 math/amd64/fabs.S
507 math/amd64/floor.S
508 math/amd64/fmod.S
509 math/amd64/ldexp.S
510 math/amd64/log.S
511 math/amd64/log10.S
512 math/amd64/pow.S
513 math/amd64/sqrt.S
514 math/amd64/tan.S)
515 endif(ARCH MATCHES i386)
516
517 if(ARCH MATCHES i386)
518 list(APPEND LIBCNTPR_SOURCE
519 mem/i386/memchr_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 asm)
573
574 # This is a temporary solution until we have proper crt libs
575 list(APPEND MSVCSUP_SOURCE
576 misc/fltused.c
577 except/i386/chkstk_asm.s
578 math/i386/ftol2_asm.S
579 )
580
581 add_library(msvcsup ${MSVCSUP_SOURCE})
582 add_dependencies(msvcsup psdk buildno_header asm)