mirror of
https://github.com/reactos/reactos.git
synced 2025-06-25 22:09:45 +00:00
[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. svn path=/trunk/; revision=56105
This commit is contained in:
parent
9d451b0782
commit
03e43b5850
13 changed files with 79 additions and 56 deletions
|
@ -162,7 +162,7 @@ SET(CMAKE_C_COMPILE_OBJECT "${CCACHE} <CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <O
|
|||
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 @@ function(set_module_type_toolchain MODULE TYPE)
|
|||
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)
|
||||
|
|
|
@ -40,7 +40,7 @@ if(${_MACHINE_ARCH_FLAG} MATCHES X86)
|
|||
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 @@ function(set_module_type_toolchain MODULE TYPE)
|
|||
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
|
||||
|
|
|
@ -4,14 +4,8 @@ add_definitions(-D__WINESRC__)
|
|||
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)
|
||||
|
||||
list(APPEND SOURCE
|
||||
|
@ -22,8 +16,11 @@ list(APPEND SOURCE
|
|||
|
||||
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)
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ list(APPEND SOURCE
|
|||
|
||||
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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -9,14 +9,6 @@ add_definitions(
|
|||
-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)
|
||||
|
||||
list(APPEND SOURCE
|
||||
|
@ -34,10 +26,22 @@ list(APPEND SOURCE
|
|||
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)
|
||||
|
|
|
@ -8,7 +8,7 @@ include_directories(
|
|||
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 @@ add_library(uniata SHARED
|
|||
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)
|
||||
|
|
|
@ -4,17 +4,20 @@ list(APPEND SOURCE
|
|||
vgadata.c
|
||||
vga.c
|
||||
vbemodes.c
|
||||
vbe.c
|
||||
vga.rc)
|
||||
vbe.c)
|
||||
|
||||
add_library(vga SHARED ${SOURCE})
|
||||
add_library(vga SHARED
|
||||
${SOURCE}
|
||||
vga.rc)
|
||||
|
||||
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)
|
||||
|
|
|
@ -6,7 +6,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
|
|||
|
||||
spec2def(portcls.sys portcls.spec)
|
||||
|
||||
add_library(portcls SHARED
|
||||
list(APPEND SOURCE
|
||||
adapter.cpp
|
||||
api.cpp
|
||||
connection.cpp
|
||||
|
@ -48,9 +48,12 @@ add_library(portcls SHARED
|
|||
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
|
||||
${PSEH_LIB})
|
||||
|
@ -58,10 +61,13 @@ target_link_libraries(portcls
|
|||
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)
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef RC_INVOKED
|
||||
|
||||
#ifndef _STLP_OUTERMOST_HEADER_ID
|
||||
# define _STLP_OUTERMOST_HEADER_ID 0x262
|
||||
# include <stl/_cprolog.h>
|
||||
|
@ -42,3 +44,5 @@
|
|||
# undef _STLP_DONT_POP_HEADER_ID
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* allow reentrancy of this header.
|
||||
*/
|
||||
|
||||
#ifndef RC_INVOKED
|
||||
|
||||
#ifdef std
|
||||
# undef std /* We undef "std" on entry , as STLport headers may include native ones. */
|
||||
#endif
|
||||
|
@ -23,3 +25,5 @@
|
|||
#if defined (_STLP_HAS_SPECIFIC_PROLOG_EPILOG)
|
||||
# include <stl/config/_prolog.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* 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
|
||||
#endif
|
||||
|
@ -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 */
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#ifndef _STLP_FEATURES_H
|
||||
#define _STLP_FEATURES_H
|
||||
|
||||
#ifndef RC_INVOKED
|
||||
|
||||
/*
|
||||
* Purpose of this file:
|
||||
*
|
||||
|
@ -1076,4 +1078,6 @@ void _STLP_DECLSPEC _STLP_CALL _STLP_CHECK_RUNTIME_COMPATIBILITY();
|
|||
#undef _STLP_NO_NEW_STYLE_CASTS
|
||||
#undef __AUTO_CONFIGURED
|
||||
|
||||
#endif /* RC_INVOKED */
|
||||
|
||||
#endif /* _STLP_FEATURES_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue