Fix a typo.Thanks to Usurp for noticing.
[reactos.git] / gcc.cmake
1
2
3 if(NOT CMAKE_CROSSCOMPILING)
4
5 add_definitions(-fshort-wchar)
6
7
8 else()
9
10 # Linking
11 link_directories("${REACTOS_SOURCE_DIR}/importlibs" ${REACTOS_BINARY_DIR}/lib/3rdparty/mingw)
12 set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
13 set(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base -Wl,--kill-at -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds")
14
15 # Compiler Core
16 add_definitions(-pipe -fms-extensions)
17
18 set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
19
20 # Debugging (Note: DWARF-4 on 4.5.1 when we ship)
21 add_definitions(-gdwarf-2 -g2 -femit-struct-debug-detailed=none -feliminate-unused-debug-types)
22
23 # Tuning
24 add_definitions(-march=pentium -mtune=i686)
25
26 # Warnings
27 add_definitions(-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-error=uninitialized -Wno-unused-value -Winvalid-pch)
28
29 # Optimizations
30 add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer -mpreferred-stack-boundary=2 -fno-set-stack-executable -fno-optimize-sibling-calls)
31
32 # C++ Flags
33 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
34
35 # Macros
36 macro(set_entrypoint MODULE ENTRYPOINT)
37 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-Wl,-entry,_${ENTRYPOINT}")
38 endmacro()
39
40 macro(add_importlibs MODULE)
41 FOREACH(LIB ${ARGN})
42 target_link_libraries(${MODULE} ${LIB}.a)
43 ENDFOREACH()
44 endmacro()
45
46 macro(set_module_type MODULE TYPE)
47 target_link_libraries(${MODULE} mingw_wmain mingw_common)
48 if(${TYPE} MATCHES win32gui)
49 set_entrypoint(${MODULE} wWinMainCRTStartup)
50 endif()
51 endmacro()
52
53 endif()
54