Author: spetreolle
Date: Sat Sep 25 14:22:16 2010
New Revision: 48871
URL:
http://svn.reactos.org/svn/reactos?rev=48871&view=rev
Log:
[CMAKE]
Add set_unicode macro.
Add win32dll module type.
Set CMAKE_CXX_LINK_EXECUTABLE.
Clear CMAKE_CXX_STANDARD_LIBRARIES.
Improve calc.
Modified:
branches/cmake-bringup/base/applications/calc/CMakeLists.txt
branches/cmake-bringup/gcc.cmake
branches/cmake-bringup/toolchain-mingw32.cmake
Modified: branches/cmake-bringup/base/applications/calc/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/base/applications…
==============================================================================
--- branches/cmake-bringup/base/applications/calc/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/base/applications/calc/CMakeLists.txt [iso-8859-1] Sat Sep 25
14:22:16 2010
@@ -12,7 +12,7 @@
resource.rc)
set_module_type(calc win32gui)
-
+set_unicode(calc yes)
add_importlibs(calc advapi32 user32 gdi32 msvcrt)
add_dependencies(calc psdk)
Modified: branches/cmake-bringup/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=488…
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Sat Sep 25 14:22:16 2010
@@ -10,6 +10,7 @@
# Linking
link_directories("${REACTOS_SOURCE_DIR}/importlibs"
${REACTOS_BINARY_DIR}/lib/3rdparty/mingw)
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS>
<CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET>
<LINK_LIBRARIES>")
+set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS>
<CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -lstdc++
-lsupc++ -lgcc -lmingwex -lmingw32 <LINK_LIBRARIES>")
set(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base
-Wl,--kill-at -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds")
# Compiler Core
@@ -30,7 +31,7 @@
add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer
-mpreferred-stack-boundary=2 -fno-set-stack-executable -fno-optimize-sibling-calls)
# C++ Flags
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
# Macros
macro(set_entrypoint MODULE ENTRYPOINT)
@@ -48,20 +49,38 @@
endmacro()
macro(set_module_type MODULE TYPE)
- target_link_libraries(${MODULE} mingw_wmain mingw_common)
+
+ add_dependencies(${MODULE} builno_header psdk)
+
if(${TYPE} MATCHES nativecui)
set_subsystem(${MODULE} native)
set_entrypoint(${MODULE} NtProcessStartup@4)
endif()
if(${TYPE} MATCHES win32gui)
set_subsystem(${MODULE} windows)
- set_entrypoint(${MODULE} wWinMainCRTStartup)
+ set_entrypoint(${MODULE} WinMainCRTStartup)
endif()
if(${TYPE} MATCHES win32cui)
set_subsystem(${MODULE} windows)
set_entrypoint(${MODULE} mainCRTStartup)
endif()
+ if(${TYPE} MATCHES win32dll)
+ target_link_libraries(${MODULE} mingw_dllmain mingw_common)
+ set_entrypoint(${MODULE} DllMain@12)
+ endif()
endmacro()
endif()
+macro(set_unicode MODULE STATE)
+ if(${STATE} MATCHES yes)
+ add_definitions(-DUNICODE -D_UNICODE)
+ target_link_libraries(${MODULE} mingw_wmain)
+ else()
+ target_link_libraries(${MODULE} mingw_main)
+ endif()
+
+ target_link_libraries(${MODULE} mingw_common)
+endmacro()
+
+
Modified: branches/cmake-bringup/toolchain-mingw32.cmake
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/toolchain-mingw32…
==============================================================================
--- branches/cmake-bringup/toolchain-mingw32.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/toolchain-mingw32.cmake [iso-8859-1] Sat Sep 25 14:22:16 2010
@@ -32,7 +32,11 @@
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE>
<CMAKE_C_LINK_FLAGS> <DEFINES> -I${REACTOS_SOURCE_DIR}/include/psdk
-I${REACTOS_BINARY_DIR}/include/psdk -I${REACTOS_SOURCE_DIR}/include/
-I${REACTOS_SOURCE_DIR}/include/reactos -I${REACTOS_BINARY_DIR}/include/reactos
-I${REACTOS_SOURCE_DIR}/include/reactos/wine -I${REACTOS_SOURCE_DIR}/include/crt
-I${REACTOS_SOURCE_DIR}/include/crt/mingw32 -O coff -o <OBJECT> ")
# Use stdcall fixups, and don't link with anything by default unless we say so
-set(CMAKE_C_STANDARD_LIBRARIES -lgcc CACHE STRING "libgcc") # We should add the
environment libgcc here
+set(CMAKE_C_STANDARD_LIBRARIES "-lgcc")
+
+MARK_AS_ADVANCED(CLEAR CMAKE_CXX_STANDARD_LIBRARIES)
+set(CMAKE_CXX_STANDARD_LIBRARIES "")
+
if(ARCH MATCHES i386)
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nodefaultlibs -nostdlib
-Wl,--enable-auto-image-base -Wl,--enable-stdcall-fixup -Wl,--kill-at
-Wl,-T,${REACTOS_SOURCE_DIR}/global.lds")
elseif(ARCH MATCHES amd64)