mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:23:05 +00:00
[CMAKE] Use new policies for CMP0005 and CMP0018 (#1481)
* [CMAKE] Fix for CMP0018 The new behaviour lets us explicitly disabling position independent code, avoiding the need to change undocumented variables * LINK_DEPENDS is semicolon separated * [CMAKE] Fix for CMP0005 it seems impossible to have cmake correct escape PROXY_CLSID_IS so move it to the header
This commit is contained in:
parent
3af58ea993
commit
716613cddc
5 changed files with 9 additions and 23 deletions
|
@ -6,12 +6,6 @@ if(NOT CMAKE_VERSION MATCHES "ReactOS")
|
||||||
message(WARNING "Building with \"${CMAKE_COMMAND}\", which is not the custom CMake included in RosBE, might cause build issues...")
|
message(WARNING "Building with \"${CMAKE_COMMAND}\", which is not the custom CMake included in RosBE, might cause build issues...")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Don't escape preprocessor definition values added via add_definitions
|
|
||||||
cmake_policy(SET CMP0005 OLD)
|
|
||||||
|
|
||||||
# Honor CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.
|
|
||||||
cmake_policy(SET CMP0018 OLD)
|
|
||||||
|
|
||||||
if(POLICY CMP0058)
|
if(POLICY CMP0058)
|
||||||
# Ninja requires custom command byproducts to be explicit
|
# Ninja requires custom command byproducts to be explicit
|
||||||
cmake_policy(SET CMP0058 OLD)
|
cmake_policy(SET CMP0058 OLD)
|
||||||
|
@ -34,6 +28,7 @@ set(CMAKE_SHARED_MODULE_PREFIX "")
|
||||||
set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE)
|
set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE)
|
||||||
set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE)
|
set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE)
|
||||||
set(CMAKE_COLOR_MAKEFILE OFF)
|
set(CMAKE_COLOR_MAKEFILE OFF)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
|
||||||
#set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
#set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
||||||
|
|
||||||
if(NOT DEFINED NEW_STYLE_BUILD)
|
if(NOT DEFINED NEW_STYLE_BUILD)
|
||||||
|
@ -65,8 +60,8 @@ include(sdk/cmake/compilerflags.cmake)
|
||||||
add_definitions(-D__REACTOS__)
|
add_definitions(-D__REACTOS__)
|
||||||
|
|
||||||
# Double escape, since CMake unescapes before putting it on the command-line, where it's unescaped again by GCC/CL.
|
# Double escape, since CMake unescapes before putting it on the command-line, where it's unescaped again by GCC/CL.
|
||||||
add_definitions(-DREACTOS_SOURCE_DIR="\\\"${REACTOS_SOURCE_DIR}\\\"")
|
add_definitions(-DREACTOS_SOURCE_DIR="${REACTOS_SOURCE_DIR}")
|
||||||
add_definitions(-DREACTOS_BINARY_DIR="\\\"${REACTOS_BINARY_DIR}\\\"")
|
add_definitions(-DREACTOS_BINARY_DIR="${REACTOS_BINARY_DIR}")
|
||||||
|
|
||||||
# There doesn't seem to be a standard for __FILE__ being relative or absolute, so detect it at runtime.
|
# There doesn't seem to be a standard for __FILE__ being relative or absolute, so detect it at runtime.
|
||||||
file(RELATIVE_PATH _PATH_PREFIX ${REACTOS_BINARY_DIR} ${REACTOS_SOURCE_DIR})
|
file(RELATIVE_PATH _PATH_PREFIX ${REACTOS_BINARY_DIR} ${REACTOS_SOURCE_DIR})
|
||||||
|
|
|
@ -4,8 +4,7 @@ add_definitions(
|
||||||
-D_URLMON_
|
-D_URLMON_
|
||||||
-DENTRY_PREFIX=URLMON_
|
-DENTRY_PREFIX=URLMON_
|
||||||
-DPROXY_DELEGATION
|
-DPROXY_DELEGATION
|
||||||
-DWINE_REGISTER_DLL
|
-DWINE_REGISTER_DLL)
|
||||||
-DPROXY_CLSID_IS="{0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}")
|
|
||||||
|
|
||||||
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
|
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
|
||||||
spec2def(urlmon.dll urlmon.spec ADD_IMPORTLIB)
|
spec2def(urlmon.dll urlmon.spec ADD_IMPORTLIB)
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
|
|
||||||
#define COBJMACROS
|
#define COBJMACROS
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
#define PROXY_CLSID_IS {0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# while others require space-separated strings. The function has a list of
|
# while others require space-separated strings. The function has a list of
|
||||||
# properties of the former variety and handles the values accordingly
|
# properties of the former variety and handles the values accordingly
|
||||||
function(add_target_property _module _propname)
|
function(add_target_property _module _propname)
|
||||||
list(APPEND _list_properties COMPILE_DEFINITIONS INCLUDE_DIRECTORIES)
|
list(APPEND _list_properties COMPILE_DEFINITIONS INCLUDE_DIRECTORIES LINK_DEPENDS)
|
||||||
set(_newvalue "")
|
set(_newvalue "")
|
||||||
get_target_property(_oldvalue ${_module} ${_propname})
|
get_target_property(_oldvalue ${_module} ${_propname})
|
||||||
if(_oldvalue)
|
if(_oldvalue)
|
||||||
|
|
|
@ -61,10 +61,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
set(CMAKE_CXX_COMPILE_OPTIONS_PIC "")
|
set(CMAKE_CXX_COMPILE_OPTIONS_PIC "")
|
||||||
set(CMAKE_C_COMPILE_OPTIONS_PIE "")
|
set(CMAKE_C_COMPILE_OPTIONS_PIE "")
|
||||||
set(CMAKE_CXX_COMPILE_OPTIONS_PIE "")
|
set(CMAKE_CXX_COMPILE_OPTIONS_PIE "")
|
||||||
set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
|
|
||||||
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
|
|
||||||
set(CMAKE_SHARED_MODULE_C_FLAGS "")
|
|
||||||
set(CMAKE_SHARED_MODULE_CXX_FLAGS "")
|
|
||||||
set(CMAKE_ASM_FLAGS_DEBUG "")
|
set(CMAKE_ASM_FLAGS_DEBUG "")
|
||||||
set(CMAKE_C_FLAGS_DEBUG "")
|
set(CMAKE_C_FLAGS_DEBUG "")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "")
|
set(CMAKE_CXX_FLAGS_DEBUG "")
|
||||||
|
@ -103,14 +99,6 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# For some reason, cmake sets -fPIC, and we don't want it
|
|
||||||
if(DEFINED CMAKE_SHARED_LIBRARY_ASM_FLAGS)
|
|
||||||
string(REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_ASM_FLAGS ${CMAKE_SHARED_LIBRARY_ASM_FLAGS})
|
|
||||||
endif()
|
|
||||||
if(DEFINED CMAKE_SHARED_MODULE_ASM_FLAGS)
|
|
||||||
string(REPLACE "-fPIC" "" CMAKE_SHARED_MODULE_ASM_FLAGS ${CMAKE_SHARED_MODULE_ASM_FLAGS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Tuning
|
# Tuning
|
||||||
if(ARCH STREQUAL "i386")
|
if(ARCH STREQUAL "i386")
|
||||||
add_compile_flags("-march=${OARCH} -mtune=${TUNE}")
|
add_compile_flags("-march=${OARCH} -mtune=${TUNE}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue