c6c1af48ab7ad9de632acf184202796dc1b1d929
[reactos.git] / reactos / sdk / lib / crt / crt.cmake
1
2 list(APPEND CRT_SOURCE
3 conio/cgets.c
4 conio/cputs.c
5 conio/getch.c
6 conio/getche.c
7 conio/kbhit.c
8 conio/putch.c
9 conio/ungetch.c
10 direct/chdir.c
11 direct/chdrive.c
12 direct/getcwd.c
13 direct/getdcwd.c
14 direct/getdfree.c
15 direct/getdrive.c
16 direct/mkdir.c
17 direct/rmdir.c
18 direct/wchdir.c
19 direct/wgetcwd.c
20 direct/wgetdcwd.c
21 direct/wmkdir.c
22 direct/wrmdir.c
23 except/cpp.c
24 except/cppexcept.c
25 except/except.c
26 except/matherr.c
27 except/stack.c
28 except/xcptfil.c
29 float/chgsign.c
30 float/copysign.c
31 float/fpclass.c
32 float/fpecode.c
33 float/isnan.c
34 float/nafter.c
35 float/scalb.c
36 locale/locale.c
37 math/abs.c
38 math/acos.c
39 math/adjust.c
40 math/asin.c
41 math/cabs.c
42 math/cosf.c
43 math/cosh.c
44 math/div.c
45 math/fdivbug.c
46 math/frexp.c
47 math/huge_val.c
48 math/hypot.c
49 math/ieee754/j0_y0.c
50 math/ieee754/j1_y1.c
51 math/ieee754/jn_yn.c
52 math/j0_y0.c
53 math/j1_y1.c
54 math/jn_yn.c
55 math/labs.c
56 math/ldiv.c
57 math/logf.c
58 math/modf.c
59 math/powf.c
60 math/rand.c
61 math/s_modf.c
62 math/sinf.c
63 math/sinh.c
64 math/tanh.c
65 mbstring/_setmbcp.c
66 mbstring/hanzen.c
67 mbstring/ischira.c
68 mbstring/iskana.c
69 mbstring/iskmoji.c
70 mbstring/iskpun.c
71 mbstring/islead.c
72 mbstring/islwr.c
73 mbstring/ismbal.c
74 mbstring/ismbaln.c
75 mbstring/ismbc.c
76 mbstring/ismbgra.c
77 mbstring/ismbkaln.c
78 mbstring/ismblead.c
79 mbstring/ismbpri.c
80 mbstring/ismbpun.c
81 mbstring/ismbtrl.c
82 mbstring/isuppr.c
83 mbstring/jistojms.c
84 mbstring/jmstojis.c
85 mbstring/mbbtype.c
86 mbstring/mbccpy.c
87 mbstring/mbclen.c
88 mbstring/mbscat.c
89 mbstring/mbschr.c
90 mbstring/mbscmp.c
91 mbstring/mbscoll.c
92 mbstring/mbscpy.c
93 mbstring/mbscspn.c
94 mbstring/mbsdec.c
95 mbstring/mbsdup.c
96 mbstring/mbsicmp.c
97 mbstring/mbsicoll.c
98 mbstring/mbsinc.c
99 mbstring/mbslen.c
100 mbstring/mbslwr.c
101 mbstring/mbsncat.c
102 mbstring/mbsnccnt.c
103 mbstring/mbsncmp.c
104 mbstring/mbsncoll.c
105 mbstring/mbsncpy.c
106 mbstring/mbsnextc.c
107 mbstring/mbsnicmp.c
108 mbstring/mbsnicoll.c
109 mbstring/mbsninc.c
110 mbstring/mbsnset.c
111 mbstring/mbspbrk.c
112 mbstring/mbsrchr.c
113 mbstring/mbsrev.c
114 mbstring/mbsset.c
115 mbstring/mbsspn.c
116 mbstring/mbsspnp.c
117 mbstring/mbsstr.c
118 mbstring/mbstok.c
119 mbstring/mbstrlen.c
120 mbstring/mbsupr.c
121 mem/memcmp.c
122 mem/memccpy.c
123 mem/memicmp.c
124 misc/__crt_MessageBoxA.c
125 misc/amsg.c
126 misc/assert.c
127 misc/environ.c
128 misc/fltused.c
129 misc/getargs.c
130 misc/i10output.c
131 misc/initterm.c
132 misc/lock.c
133 misc/purecall.c
134 misc/stubs.c
135 misc/tls.c
136 printf/_cprintf.c
137 printf/_cwprintf.c
138 printf/_snprintf.c
139 printf/_snprintf_s.c
140 printf/_snwprintf.c
141 printf/_snwprintf_s.c
142 printf/_vcprintf.c
143 printf/_vcwprintf.c
144 printf/_vscprintf.c
145 printf/_vscwprintf.c
146 printf/_vsnprintf.c
147 printf/_vsnprintf_s.c
148 printf/_vsnwprintf.c
149 printf/_vsnwprintf_s.c
150 printf/_vsprintf_p.c
151 printf/fprintf.c
152 printf/fprintf_s.c
153 printf/fwprintf.c
154 printf/fwprintf_s.c
155 printf/printf.c
156 printf/printf_s.c
157 printf/sprintf.c
158 printf/sprintf_s.c
159 printf/streamout.c
160 printf/swprintf.c
161 printf/swprintf_s.c
162 printf/vfprintf.c
163 printf/vfprintf_s.c
164 printf/vfwprintf.c
165 printf/vfwprintf_s.c
166 printf/vprintf.c
167 printf/vprintf_s.c
168 printf/vsprintf.c
169 printf/vsprintf_s.c
170 printf/vswprintf.c
171 printf/vswprintf_s.c
172 printf/vwprintf.c
173 printf/vwprintf_s.c
174 printf/wprintf.c
175 printf/wprintf_s.c
176 printf/wstreamout.c
177 process/_cwait.c
178 process/_system.c
179 process/dll.c
180 process/process.c
181 process/procid.c
182 process/thread.c
183 process/threadid.c
184 process/threadx.c
185 process/wprocess.c
186 search/bsearch.c
187 search/lfind.c
188 search/lsearch.c
189 signal/signal.c
190 signal/xcptinfo.c
191 startup/crtexe.c
192 startup/wcrtexe.c
193 startup/crt_handler.c
194 startup/crtdll.c
195 startup/_newmode.c
196 startup/wildcard.c
197 startup/tlssup.c
198 startup/mingw_helpers.c
199 startup/natstart.c
200 startup/charmax.c
201 #startup/merr.c
202 #startup/atonexit.c
203 #startup/txtmode.c
204 startup/pesect.c
205 startup/tlsmcrt.c
206 startup/tlsthrd.c
207 startup/tlsmthread.c
208 startup/cinitexe.c
209 startup/gs_support.c
210 startup/dll_argv.c
211 startup/dllargv.c
212 startup/wdllargv.c
213 startup/crt0_c.c
214 startup/crt0_w.c
215 startup/dllentry.c
216 startup/reactos.c
217 stdio/_flsbuf.c
218 stdio/_flswbuf.c
219 stdio/access.c
220 stdio/file.c
221 stdio/find.c
222 stdio/find64.c
223 stdio/findi64.c
224 stdio/fmode.c
225 stdio/perror.c
226 stdio/popen.c
227 stdio/stat.c
228 stdio/stat64.c
229 stdio/waccess.c
230 stdio/wfind.c
231 stdio/wfind64.c
232 stdio/wfindi64.c
233 stdio/wpopen.c
234 stdio/wstat.c
235 stdio/wstat64.c
236 stdlib/_exit.c
237 stdlib/_set_abort_behavior.c
238 stdlib/abort.c
239 stdlib/atexit.c
240 stdlib/ecvt.c
241 stdlib/errno.c
242 stdlib/fcvt.c
243 stdlib/fcvtbuf.c
244 stdlib/fullpath.c
245 stdlib/gcvt.c
246 stdlib/getenv.c
247 stdlib/makepath.c
248 stdlib/makepath_s.c
249 stdlib/mbtowc.c
250 stdlib/mbstowcs.c
251 stdlib/obsol.c
252 stdlib/putenv.c
253 stdlib/qsort.c
254 stdlib/rot.c
255 stdlib/senv.c
256 stdlib/swab.c
257 stdlib/wfulpath.c
258 stdlib/wputenv.c
259 stdlib/wsenv.c
260 stdlib/wmakpath.c
261 stdlib/wmakpath_s.c
262 string/_mbsnlen.c
263 string/_mbstrnlen.c
264 string/_splitpath.c
265 string/_splitpath_s.c
266 string/_wcslwr_s.c
267 string/_wsplitpath.c
268 string/_wsplitpath_s.c
269 string/atof.c
270 string/atoi.c
271 string/atoi64.c
272 string/atol.c
273 string/ctype.c
274 string/iswctype.c
275 string/is_wctype.c
276 string/itoa.c
277 string/itow.c
278 string/mbstowcs_s.c
279 string/scanf.c
280 string/strcoll.c
281 string/strcspn.c
282 string/strdup.c
283 string/strerror.c
284 string/stricmp.c
285 string/string.c
286 string/strlwr.c
287 string/strncoll.c
288 string/strnicmp.c
289 string/strpbrk.c
290 string/strrev.c
291 string/strset.c
292 string/strspn.c
293 string/strstr.c
294 string/strtod.c
295 string/strtoi64.c
296 string/strtok.c
297 #string/strtok_s.c
298 string/strtol.c
299 string/strtoul.c
300 string/strtoull.c
301 string/strupr.c
302 string/strxfrm.c
303 string/wcs.c
304 string/wcstol.c
305 string/wcstombs_s.c
306 string/wcstoul.c
307 string/wctype.c
308 string/wtoi.c
309 string/wtoi64.c
310 string/wtol.c
311 string/winesup.c
312 sys_stat/systime.c
313 time/asctime.c
314 time/clock.c
315 time/ctime32.c
316 time/ctime64.c
317 time/ctime.c
318 time/difftime32.c
319 time/difftime64.c
320 time/difftime.c
321 time/ftime32.c
322 time/ftime64.c
323 time/ftime.c
324 time/futime32.c
325 time/futime64.c
326 time/futime.c
327 time/gmtime.c
328 time/localtime32.c
329 time/localtime64.c
330 time/localtime.c
331 time/mktime.c
332 time/strdate.c
333 time/strftime.c
334 time/strtime.c
335 time/time32.c
336 time/time64.c
337 time/time.c
338 time/timezone.c
339 time/utime32.c
340 time/utime64.c
341 time/utime.c
342 time/wasctime.c
343 time/wctime32.c
344 time/wctime64.c
345 time/wctime.c
346 time/wstrdate.c
347 time/wstrtime.c
348 time/wutime32.c
349 time/wutime64.c
350 time/wutime.c
351 wstring/wcscoll.c
352 wstring/wcscspn.c
353 wstring/wcsicmp.c
354 wstring/wcslwr.c
355 wstring/wcsnicmp.c
356 wstring/wcsspn.c
357 wstring/wcsstr.c
358 wstring/wcstok.c
359 wstring/wcsupr.c
360 wstring/wcsxfrm.c
361 wine/heap.c
362 wine/undname.c)
363
364 if(ARCH STREQUAL "i386")
365 list(APPEND CRT_ASM_SOURCE
366 except/i386/chkesp.s
367 except/i386/prolog.s
368 except/i386/seh.s
369 except/i386/seh_prolog.s
370 math/i386/alldiv_asm.s
371 math/i386/alldvrm_asm.s
372 math/i386/allmul_asm.s
373 math/i386/allrem_asm.s
374 math/i386/allshl_asm.s
375 math/i386/allshr_asm.s
376 math/i386/atan_asm.s
377 math/i386/aulldiv_asm.s
378 math/i386/aulldvrm_asm.s
379 math/i386/aullrem_asm.s
380 math/i386/aullshr_asm.s
381 math/i386/ceil_asm.s
382 math/i386/ceilf.S
383 math/i386/cos_asm.s
384 math/i386/fabs_asm.s
385 math/i386/floor_asm.s
386 math/i386/floorf.S
387 math/i386/ftol_asm.s
388 math/i386/ftol2_asm.s
389 math/i386/log_asm.s
390 math/i386/log10_asm.s
391 math/i386/pow_asm.s
392 math/i386/sin_asm.s
393 math/i386/sqrt_asm.s
394 math/i386/tan_asm.s
395 math/i386/atan2_asm.s
396 math/i386/exp_asm.s
397 math/i386/fmod_asm.s
398 math/i386/fmodf_asm.s
399 mem/i386/memchr_asm.s
400 mem/i386/memmove_asm.s
401 mem/i386/memset_asm.s
402 misc/i386/readcr4.S
403 setjmp/i386/setjmp.s
404 string/i386/strcat_asm.s
405 string/i386/strchr_asm.s
406 string/i386/strcmp_asm.s
407 string/i386/strcpy_asm.s
408 string/i386/strlen_asm.s
409 string/i386/strncat_asm.s
410 string/i386/strncmp_asm.s
411 string/i386/strncpy_asm.s
412 string/i386/strnlen_asm.s
413 string/i386/strrchr_asm.s
414 string/i386/wcscat_asm.s
415 string/i386/wcschr_asm.s
416 string/i386/wcscmp_asm.s
417 string/i386/wcscpy_asm.s
418 string/i386/wcslen_asm.s
419 string/i386/wcsncat_asm.s
420 string/i386/wcsncmp_asm.s
421 string/i386/wcsncpy_asm.s
422 string/i386/wcsnlen_asm.s
423 string/i386/wcsrchr_asm.s)
424
425 list(APPEND CRT_SOURCE
426 except/i386/unwind.c
427 float/i386/clearfp.c
428 float/i386/cntrlfp.c
429 float/i386/fpreset.c
430 float/i386/logb.c
431 float/i386/statfp.c
432 math/i386/ci.c
433 math/i386/cicos.c
434 math/i386/cilog.c
435 math/i386/cipow.c
436 math/i386/cisin.c
437 math/i386/cisqrt.c
438 math/i386/ldexp.c)
439 if(MSVC)
440 list(APPEND CRT_ASM_SOURCE
441 except/i386/cpp.s)
442 endif()
443 elseif(ARCH STREQUAL "amd64")
444 list(APPEND CRT_ASM_SOURCE
445 except/amd64/seh.s
446 float/amd64/clearfp.S
447 float/amd64/getsetfpcw.S
448 float/amd64/fpreset.S
449 float/amd64/logb.S
450 # math/amd64/acos.S
451 # math/amd64/acosf.S
452 math/amd64/atan.S
453 math/amd64/atan2.S
454 math/amd64/ceil.S
455 # math/amd64/ceilf.S
456 math/amd64/exp.S
457 math/amd64/fabs.S
458 math/amd64/floor.S
459 # math/amd64/floorf.S
460 math/amd64/fmod.S
461 # math/amd64/fmodf.S
462 math/amd64/ldexp.S
463 math/amd64/log.S
464 math/amd64/log10.S
465 math/amd64/pow.S
466 math/amd64/sqrt.S
467 # math/amd64/sqrtf.S
468 math/amd64/tan.S
469 setjmp/amd64/setjmp.s)
470
471 list(APPEND CRT_SOURCE
472 except/amd64/ehandler.c
473 float/i386/cntrlfp.c
474 float/i386/statfp.c)
475 if(MSVC)
476 list(APPEND CRT_ASM_SOURCE
477 except/amd64/cpp.s)
478 endif()
479 elseif(ARCH STREQUAL "arm")
480 list(APPEND CRT_SOURCE
481 except/arm/ehandler.c
482 math/fabsf.c
483 math/sqrt.c
484 math/arm/__rt_sdiv.c
485 math/arm/__rt_sdiv64_worker.c
486 math/arm/__rt_udiv.c
487 math/arm/__rt_udiv64_worker.c
488 )
489 list(APPEND CRT_ASM_SOURCE
490 except/arm/_abnormal_termination.s
491 except/arm/_except_handler2.s
492 except/arm/_except_handler3.s
493 except/arm/_global_unwind2.s
494 except/arm/_local_unwind2.s
495 except/arm/chkstk_asm.s
496 float/arm/_clearfp.s
497 float/arm/_controlfp.s
498 float/arm/_fpreset.s
499 float/arm/_statusfp.s
500 math/arm/atan.s
501 math/arm/atan2.s
502 math/arm/ceil.s
503 math/arm/exp.s
504 math/arm/fabs.s
505 math/arm/fmod.s
506 math/arm/floor.s
507 math/arm/ldexp.s
508 math/arm/log.s
509 math/arm/log10.s
510 math/arm/pow.s
511 math/arm/tan.s
512 math/arm/_logb.s
513 math/arm/__dtoi64.s
514 math/arm/__dtou64.s
515 math/arm/__i64tod.s
516 math/arm/__i64tos.s
517 math/arm/__stoi64.s
518 math/arm/__stou64.s
519 math/arm/__u64tod.s
520 math/arm/__u64tos.s
521 math/arm/__rt_sdiv64.s
522 math/arm/__rt_srsh.s
523 math/arm/__rt_udiv64.s
524 setjmp/arm/setjmp.s
525 )
526 if(MSVC)
527 list(APPEND CRT_ASM_SOURCE
528 except/arm/cpp.s)
529 endif()
530 endif()
531
532 if(NOT ARCH STREQUAL "i386")
533 list(APPEND CRT_SOURCE
534 math/_chgsignf.c
535 math/_copysignf.c
536 math/_hypotf.c
537 math/acosf.c
538 math/asinf.c
539 math/atan2f.c
540 math/atanf.c
541 math/ceilf.c
542 math/cos.c
543 math/coshf.c
544 math/expf.c
545 math/floorf.c
546 math/fmodf.c
547 math/log10f.c
548 math/modff.c
549 math/sin.c
550 math/sinhf.c
551 math/sqrt.c
552 math/sqrtf.c
553 math/tanf.c
554 math/tanhf.c
555 math/stubs.c
556 mem/memchr.c
557 mem/memcpy.c
558 mem/memmove.c
559 mem/memset.c
560 string/strcat.c
561 string/strchr.c
562 string/strcmp.c
563 string/strcpy.c
564 string/strlen.c
565 string/strncat.c
566 string/strncmp.c
567 string/strncpy.c
568 string/strnlen.c
569 string/strrchr.c
570 string/wcscat.c
571 string/wcschr.c
572 string/wcscmp.c
573 string/wcscpy.c
574 string/wcslen.c
575 string/wcsncat.c
576 string/wcsncmp.c
577 string/wcsncpy.c
578 string/wcsnlen.c
579 string/wcsrchr.c)
580 endif()
581
582 set_source_files_properties(${CRT_ASM_SOURCE} PROPERTIES COMPILE_DEFINITIONS "__MINGW_IMPORT=extern;USE_MSVCRT_PREFIX;_MSVCRT_LIB_;_MSVCRT_;_MT;CRTDLL")
583 add_asm_files(crt_asm ${CRT_ASM_SOURCE})
584
585 if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
586 #FIXME: http://llvm.org/bugs/show_bug.cgi?id=19027
587 set_property(SOURCE except/cpp.c APPEND_STRING PROPERTY COMPILE_FLAGS " -no-integrated-as")
588 endif()
589
590 add_library(crt ${CRT_SOURCE} ${crt_asm})
591 target_link_libraries(crt chkstk)
592 add_target_compile_definitions(crt
593 __MINGW_IMPORT=extern
594 USE_MSVCRT_PREFIX
595 _MSVCRT_LIB_
596 _MSVCRT_
597 _MT
598 CRTDLL)
599 #add_pch(crt precomp.h)
600 add_dependencies(crt psdk asm)