fb99ca0700d06417ccb57fa0918501a6a20d4f04
[reactos.git] / reactos / lib / sdk / crt / msvcrtex.cmake
1
2 include_directories(include/internal/mingw-w64)
3
4 if(NOT MSVC)
5 add_compile_flags("-Wno-main")
6 if(LTCG)
7 add_compile_flags("-fno-lto")
8 endif()
9 endif()
10
11 list(APPEND MSVCRTEX_SOURCE
12 startup/crtexe.c
13 startup/wcrtexe.c
14 startup/crt_handler.c
15 startup/crtdll.c
16 startup/_newmode.c
17 startup/wildcard.c
18 startup/tlssup.c
19 startup/mingw_helpers.c
20 startup/natstart.c
21 startup/charmax.c
22 startup/merr.c
23 startup/atonexit.c
24 startup/txtmode.c
25 startup/pesect.c
26 startup/tlsmcrt.c
27 startup/tlsthrd.c
28 startup/tlsmthread.c
29 startup/cinitexe.c
30 startup/gs_support.c
31 startup/dll_argv.c
32 startup/dllargv.c
33 startup/wdllargv.c
34 startup/crt0_c.c
35 startup/crt0_w.c
36 startup/dllentry.c
37 startup/reactos.c
38 misc/fltused.c
39 misc/isblank.c
40 misc/iswblank.c
41 misc/ofmt_stub.c
42 )
43
44 if(NOT MSVC)
45 list(APPEND MSVCRTEX_SOURCE
46 startup/pseudo-reloc.c
47 startup/pseudo-reloc-list.c)
48 endif()
49
50 if(ARCH MATCHES i386)
51 list(APPEND MSVCRTEX_SOURCE
52 except/i386/chkstk_asm.s
53 except/i386/chkstk_ms.s
54 math/i386/ci.c
55 math/i386/cicos.c
56 math/i386/cilog.c
57 math/i386/cipow.c
58 math/i386/cisin.c
59 math/i386/cisqrt.c
60 math/i386/ftol2_asm.s
61 math/i386/alldiv_asm.s)
62 elseif(ARCH MATCHES amd64)
63 list(APPEND MSVCRTEX_SOURCE
64 except/amd64/chkstk_asm.s
65 except/amd64/chkstk_ms.s)
66 endif()
67
68 if(MSVC)
69 list(APPEND MSVCRTEX_SOURCE
70 startup/mscmain.c
71 startup/mscdllmain.c)
72 else()
73 list(APPEND MSVCRTEX_SOURCE startup/gccmain.c)
74 endif()
75
76 add_library(msvcrtex ${MSVCRTEX_SOURCE})
77 add_target_compile_definitions(msvcrtex _DLL _MSVCRTEX_)
78 set_source_files_properties(startup/crtdll.c PROPERTIES COMPILE_DEFINITIONS CRTDLL)
79 set_source_files_properties(startup/crtexe.c
80 startup/wcrtexe.c PROPERTIES COMPILE_DEFINITIONS _M_CEE_PURE)
81
82 if(NOT MSVC)
83 target_link_libraries(msvcrtex oldnames)
84 allow_warnings(msvcrtex)
85 endif()
86
87 add_dependencies(msvcrtex psdk asm)