Author: akhaldi
Date: Sat Mar 10 19:20:27 2012
New Revision: 56105
URL:
http://svn.reactos.org/svn/reactos?rev=56105&view=rev
Log:
[CMAKE]
* Make use of the cmake rc handling. As a result we don't need set_rc_compiler()
anymore, among other benefits.
* There's one minor issue mentioned as a FIXME, we'll get that sorted out as soon
as the bug report we filed upstream gets resolved.
* Set set_rc_compiler() to be a dummy, to be removed later.
[IMM32]
* Properly set the compiler flag.
Modified:
trunk/reactos/cmake/gcc.cmake
trunk/reactos/cmake/msvc.cmake
trunk/reactos/dll/win32/imm32/CMakeLists.txt
trunk/reactos/drivers/filters/mountmgr/CMakeLists.txt
trunk/reactos/drivers/storage/class/disk_new/CMakeLists.txt
trunk/reactos/drivers/storage/classpnp/CMakeLists.txt
trunk/reactos/drivers/storage/ide/uniata/CMakeLists.txt
trunk/reactos/drivers/video/miniport/vga_new/CMakeLists.txt
trunk/reactos/drivers/wdm/audio/backpln/portcls/CMakeLists.txt
trunk/reactos/include/c++/stlport/stddef.h
trunk/reactos/include/c++/stlport/stl/_cprolog.h
trunk/reactos/include/c++/stlport/stl/config/compat.h
trunk/reactos/include/c++/stlport/stl/config/features.h
Modified: trunk/reactos/cmake/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/gcc.cmake?rev=56105&…
==============================================================================
--- trunk/reactos/cmake/gcc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/gcc.cmake [iso-8859-1] Sat Mar 10 19:20:27 2012
@@ -162,7 +162,7 @@
SET(CMAKE_CXX_COMPILE_OBJECT "${CCACHE} <CMAKE_CXX_COMPILER> <DEFINES>
<FLAGS> -o <OBJECT> -c <SOURCE>")
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o
<OBJECT> -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm
<FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>")
-set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE>
<CMAKE_C_LINK_FLAGS> <DEFINES> ${I18N_DEFS} -DRC_INVOKED -D__WIN32__=1
-D__FLAT__=1 -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>")
+set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS>
-DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES> <SOURCE>
<OBJECT>")
# Optional 3rd parameter: stdcall stack bytes
function(set_entrypoint MODULE ENTRYPOINT)
@@ -198,18 +198,6 @@
endfunction()
function(set_rc_compiler)
- get_directory_property(defines COMPILE_DEFINITIONS)
- get_directory_property(includes INCLUDE_DIRECTORIES)
-
- foreach(arg ${defines})
- set(rc_result_defs "${rc_result_defs} -D${arg}")
- endforeach()
-
- foreach(arg ${includes})
- set(rc_result_incs "-I${arg} ${rc_result_incs}")
- endforeach()
-
- set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_result_defs}
${I18N_DEFS} -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 -I${CMAKE_CURRENT_SOURCE_DIR}
${rc_result_incs} -i <SOURCE> -O coff -o <OBJECT>" PARENT_SCOPE)
endfunction()
function(add_delay_importlibs MODULE)
Modified: trunk/reactos/cmake/msvc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=56105…
==============================================================================
--- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Sat Mar 10 19:20:27 2012
@@ -40,7 +40,7 @@
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO
/NODEFAULTLIB /RELEASE")
endif()
-set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <DEFINES> ${I18N_DEFS}
/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 /fo
<OBJECT> <SOURCE>")
+set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES>
${I18N_DEFS} /fo<OBJECT> <SOURCE>")
if(MSVC_IDE)
# Asm source files are not supported in VS generators yet. As a result,
<DEFINES> isn't recognized.
@@ -111,18 +111,6 @@
endfunction()
function(set_rc_compiler)
- get_directory_property(defines COMPILE_DEFINITIONS)
- get_directory_property(includes INCLUDE_DIRECTORIES)
-
- foreach(arg ${defines})
- set(rc_result_defs "${rc_result_defs} /D${arg}")
- endforeach()
-
- foreach(arg ${includes})
- set(rc_result_incs "/I${arg} ${rc_result_incs}")
- endforeach()
-
- set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_result_defs}
${I18N_DEFS} /I${CMAKE_CURRENT_SOURCE_DIR} ${rc_result_incs} /fo <OBJECT>
<SOURCE>" PARENT_SCOPE)
endfunction()
#define those for having real libraries
Modified: trunk/reactos/dll/win32/imm32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/imm32/CMakeLists…
==============================================================================
--- trunk/reactos/dll/win32/imm32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/imm32/CMakeLists.txt [iso-8859-1] Sat Mar 10 19:20:27 2012
@@ -4,13 +4,7 @@
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
-if(MSVC)
- add_definitions(/FIwine/typeof.h)
-endif()
-
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
-
-set_rc_compiler()
spec2def(imm32.dll imm32.spec ADD_IMPORTLIB)
@@ -22,8 +16,11 @@
add_library(imm32 SHARED ${SOURCE})
+if(MSVC)
+ add_target_compile_flags(imm32 "/FIwine/typeof.h")
+endif()
+
set_module_type(imm32 win32dll)
target_link_libraries(imm32 wine)
add_importlibs(imm32 advapi32 user32 msvcrt kernel32 ntdll)
add_cd_file(TARGET imm32 DESTINATION reactos/system32 FOR all)
-
Modified: trunk/reactos/drivers/filters/mountmgr/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/C…
==============================================================================
--- trunk/reactos/drivers/filters/mountmgr/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/drivers/filters/mountmgr/CMakeLists.txt [iso-8859-1] Sat Mar 10 19:20:27
2012
@@ -11,8 +11,8 @@
add_library(mountmgr SHARED ${SOURCE})
target_link_libraries(mountmgr wdmguid ioevent)
-allow_warnings(mountmgr)
set_module_type(mountmgr kernelmodedriver)
add_importlibs(mountmgr ntoskrnl hal)
add_pch(mountmgr mntmgr.h)
add_cd_file(TARGET mountmgr DESTINATION reactos/system32/drivers NO_CAB FOR all)
+
Modified: trunk/reactos/drivers/storage/class/disk_new/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/disk…
==============================================================================
--- trunk/reactos/drivers/storage/class/disk_new/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/disk_new/CMakeLists.txt [iso-8859-1] Sat Mar 10
19:20:27 2012
@@ -1,13 +1,26 @@
include_directories(..)
-add_library(disk_new SHARED data.c disk.c diskwmi.c enum.c geometry.c part.c pnp.c
disk.rc)
+list(APPEND SOURCE
+ data.c
+ disk.c
+ diskwmi.c
+ enum.c
+ geometry.c
+ part.c
+ pnp.c)
+
+add_library(disk_new SHARED
+ ${SOURCE}
+ disk.rc)
target_link_libraries(disk_new libcntpr wdmguid)
if(ARCH MATCHES i386)
if(MSVC)
add_target_compile_flags(disk_new "/Gz")
else()
- add_target_compile_flags(disk_new "-mrtd -fno-builtin -Wno-unused-variable
-Wno-pointer-sign")
+ # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
+ #add_target_compile_flags(disk_new "-mrtd -fno-builtin -Wno-unused-variable
-Wno-pointer-sign")
+ set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-mrtd
-fno-builtin -Wno-unused-variable -Wno-pointer-sign")
endif()
endif()
Modified: trunk/reactos/drivers/storage/classpnp/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/C…
==============================================================================
--- trunk/reactos/drivers/storage/classpnp/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/classpnp/CMakeLists.txt [iso-8859-1] Sat Mar 10 19:20:27
2012
@@ -8,14 +8,6 @@
-DCLASS_GLOBAL_BUFFERED_DEBUG_PRINT=0
-DCLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFER_SIZE=512
-DCLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS=512)
-
-if(ARCH MATCHES i386)
- if(MSVC)
- add_definitions(/Gz)
- else()
- add_definitions(-mrtd -fno-builtin -w)
- endif()
-endif()
spec2def(classpnp.sys classpnp.spec ADD_IMPORTLIB)
@@ -34,10 +26,22 @@
retry.c
utils.c
xferpkt.c
- class.rc
${CMAKE_CURRENT_BINARY_DIR}/classpnp.def)
-add_library(classpnp SHARED ${SOURCE})
+add_library(classpnp SHARED
+ ${SOURCE}
+ class.rc)
+
+if(ARCH MATCHES i386)
+ if(MSVC)
+ add_target_compile_flags(classpnp "/Gz")
+ else()
+ # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
+ #add_target_compile_flags(classpnp "-mrtd -fno-builtin -w")
+ set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-mrtd
-fno-builtin -w")
+ endif()
+endif()
+
add_pch(classpnp classp.h)
target_link_libraries(classpnp ${PSEH_LIB} libcntpr)
set_module_type(classpnp kernelmodedriver)
Modified: trunk/reactos/drivers/storage/ide/uniata/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/ide/uniata/CMakeLists.txt [iso-8859-1] Sat Mar 10
19:20:27 2012
@@ -8,7 +8,7 @@
set_cpp()
set_rc_compiler()
-add_library(uniata SHARED
+list(APPEND SOURCE
id_ata.cpp
id_badblock.cpp
id_dma.cpp
@@ -16,10 +16,18 @@
id_probe.cpp
id_queue.cpp
id_sata.cpp
- idedma.rc
ros_glue/ros_glue.cpp)
-allow_warnings(uniata)
+add_library(uniata SHARED
+ ${SOURCE}
+ idedma.rc)
+
+if(NOT MSVC)
+ # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
+ #allow_warnings(uniata)
+ set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS
"-Wno-error")
+endif()
+
add_pch(uniata stdafx.h)
set_module_type(uniata kernelmodedriver)
add_importlibs(uniata scsiport ntoskrnl hal)
Modified: trunk/reactos/drivers/video/miniport/vga_new/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vga…
==============================================================================
--- trunk/reactos/drivers/video/miniport/vga_new/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/drivers/video/miniport/vga_new/CMakeLists.txt [iso-8859-1] Sat Mar 10
19:20:27 2012
@@ -4,17 +4,20 @@
vgadata.c
vga.c
vbemodes.c
- vbe.c
+ vbe.c)
+
+add_library(vga SHARED
+ ${SOURCE}
vga.rc)
-
-add_library(vga SHARED ${SOURCE})
target_link_libraries(vga libcntpr)
if(MSVC)
add_target_compile_flags(vga "/Gz")
else()
- add_target_compile_flags(vga "-mrtd -fno-builtin")
+ # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
+ #add_target_compile_flags(vga "-mrtd -fno-builtin")
+ set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-mrtd
-fno-builtin")
endif()
set_module_type(vga kernelmodedriver)
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/CMakeLists.txt [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/CMakeLists.txt [iso-8859-1] Sat Mar 10
19:20:27 2012
@@ -6,7 +6,7 @@
spec2def(portcls.sys portcls.spec)
-add_library(portcls SHARED
+list(APPEND SOURCE
adapter.cpp
api.cpp
connection.cpp
@@ -48,8 +48,11 @@
undoc.cpp
unregister.cpp
version.cpp
- portcls.rc
${CMAKE_CURRENT_BINARY_DIR}/portcls.def)
+
+add_library(portcls SHARED
+ ${SOURCE}
+ portcls.rc)
target_link_libraries(portcls
libcntpr
@@ -58,10 +61,13 @@
if(MSVC)
add_target_compile_flags(portcls "/GR-")
else()
- add_target_compile_flags(portcls "-fno-exceptions -fno-rtti")
+ # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
+ #add_target_compile_flags(portcls "-fno-exceptions -fno-rtti")
+ set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-fno-exceptions
-fno-rtti")
endif()
set_module_type(portcls kernelmodedriver ENTRYPOINT 0 )
add_pch(portcls private.hpp)
add_importlibs(portcls ntoskrnl ks drmk hal)
add_cd_file(TARGET portcls DESTINATION reactos/system32/drivers FOR all)
+
Modified: trunk/reactos/include/c++/stlport/stddef.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/c%2B%2B/stlport/st…
==============================================================================
--- trunk/reactos/include/c++/stlport/stddef.h [iso-8859-1] (original)
+++ trunk/reactos/include/c++/stlport/stddef.h [iso-8859-1] Sat Mar 10 19:20:27 2012
@@ -12,6 +12,8 @@
* modified is included with the above copyright notice.
*
*/
+
+#ifndef RC_INVOKED
#ifndef _STLP_OUTERMOST_HEADER_ID
# define _STLP_OUTERMOST_HEADER_ID 0x262
@@ -42,3 +44,5 @@
# undef _STLP_DONT_POP_HEADER_ID
# endif
#endif
+
+#endif
Modified: trunk/reactos/include/c++/stlport/stl/_cprolog.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/c%2B%2B/stlport/st…
==============================================================================
--- trunk/reactos/include/c++/stlport/stl/_cprolog.h [iso-8859-1] (original)
+++ trunk/reactos/include/c++/stlport/stl/_cprolog.h [iso-8859-1] Sat Mar 10 19:20:27
2012
@@ -3,6 +3,8 @@
* please also find #pragma which disables it and put it here, to
* allow reentrancy of this header.
*/
+
+#ifndef RC_INVOKED
#ifdef std
# undef std /* We undef "std" on entry , as STLport headers may include native
ones. */
@@ -23,3 +25,5 @@
#if defined (_STLP_HAS_SPECIFIC_PROLOG_EPILOG)
# include <stl/config/_prolog.h>
#endif
+
+#endif
Modified: trunk/reactos/include/c++/stlport/stl/config/compat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/c%2B%2B/stlport/st…
==============================================================================
--- trunk/reactos/include/c++/stlport/stl/config/compat.h [iso-8859-1] (original)
+++ trunk/reactos/include/c++/stlport/stl/config/compat.h [iso-8859-1] Sat Mar 10 19:20:27
2012
@@ -3,6 +3,8 @@
* Compatibility section
* This section sets new-style macros based on old-style ones, for compatibility
*/
+
+#ifndef RC_INVOKED
#if defined (__STL_DEBUG) && !defined (_STLP_DEBUG)
# define _STLP_DEBUG __STL_DEBUG
@@ -78,3 +80,5 @@
# error STLport do not support anymore the wrapper mode. If you want to use STLport \
use its iostreams implementation or no iostreams at all.
#endif
+
+#endif /* RC_INVOKED */
Modified: trunk/reactos/include/c++/stlport/stl/config/features.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/c%2B%2B/stlport/st…
==============================================================================
--- trunk/reactos/include/c++/stlport/stl/config/features.h [iso-8859-1] (original)
+++ trunk/reactos/include/c++/stlport/stl/config/features.h [iso-8859-1] Sat Mar 10
19:20:27 2012
@@ -26,6 +26,8 @@
#ifndef _STLP_FEATURES_H
#define _STLP_FEATURES_H
+#ifndef RC_INVOKED
+
/*
* Purpose of this file:
*
@@ -1076,4 +1078,6 @@
#undef _STLP_NO_NEW_STYLE_CASTS
#undef __AUTO_CONFIGURED
+#endif /* RC_INVOKED */
+
#endif /* _STLP_FEATURES_H */