[CMAKE]
[reactos.git] / lib / 3rdparty / mingw / CMakeLists.txt
1
2 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/mingw-w64)
3
4 add_definitions(-D_CRTBLD -Wno-main)
5
6 set(MINGW_COMMON_SOURCE
7 _newmode.c
8 atonexit.c
9 binmode.c
10 charmax.c
11 cinitexe.c
12 CRT_fp10.c
13 CRT_fp8.c
14 CRT_glob.c
15 crt_handler.c
16 dllentry.c
17 gccmain.c
18 gs_support.c
19 merr.c
20 mingw_helpers.c
21 natstart.c
22 pesect.c
23 pseudo-reloc.c
24 pseudo-reloc-list.c
25 tlsmcrt.c
26 tlssup.c
27 tlsthrd.c
28 txtmode.c
29 wildcard.c
30 xncommod.c
31 xthdloc.c
32 xtxtmode.c
33 ofmt_stub.c
34 cxa_pure_virtual.c
35 )
36
37 add_library(mingw_common ${MINGW_COMMON_SOURCE})
38 target_link_libraries(mingw_common oldnames)
39
40 set_target_properties(mingw_common PROPERTIES COMPILE_DEFINITIONS _M_CEE_PURE)
41
42 add_dependencies(mingw_common psdk)
43
44
45 add_library(mingw_main crt0_c.c crtexe.c dllargv.c)
46 set_property(TARGET mingw_main PROPERTY COMPILE_DEFINITIONS _DLL __USE_CRTIMP)
47 add_dependencies(mingw_main psdk)
48
49 add_library(mingw_wmain crt0_c.c crtexe.c dllargv.c)
50 set_property(TARGET mingw_wmain PROPERTY COMPILE_DEFINITIONS WPRFLAG UNICODE _UNICODE)
51 add_dependencies(mingw_wmain psdk)
52
53 add_library(mingw_dllmain crtdll.c dllargv.c)
54 add_dependencies(mingw_dllmain psdk)
55
56 ADD_CUSTOM_COMMAND(
57 OUTPUT ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw/oldnames.a
58 COMMAND ${MINGW_PREFIX}dlltool --def ${REACTOS_SOURCE_DIR}/lib/3rdparty/mingw/moldname-msvcrt.def --kill-at --output-lib ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw/oldnames.a
59 COMMAND ${MINGW_PREFIX}ar -rc ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw/oldnames.a
60 )
61
62 SET_SOURCE_FILES_PROPERTIES(${REACTOS_BINARY_DIR}/lib/3rdparty/mingw/oldnames.a PROPERTIES GENERATED TRUE)
63
64 ADD_CUSTOM_TARGET(oldnames ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw/oldnames.a)
65
66 add_library(getopt getopt.c)
67 set_property(TARGET getopt PROPERTY COMPILE_DEFINITIONS _DLL __USE_CRTIMP)
68 add_dependencies(getopt psdk)