https://git.reactos.org/?p=reactos.git;a=commitdiff;h=716613cddc8039eff5f09…
commit 716613cddc8039eff5f095051dc9a79727a25e73
Author: Andrew Cook <ariscop(a)gmail.com>
AuthorDate: Sat Apr 27 19:33:37 2019 +1000
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Apr 27 11:33:37 2019 +0200
[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
---
CMakeLists.txt | 11 +++--------
dll/win32/urlmon/CMakeLists.txt | 3 +--
dll/win32/urlmon/urlmon_main.h | 4 ++++
sdk/cmake/compilerflags.cmake | 2 +-
sdk/cmake/gcc.cmake | 12 ------------
5 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b66140da1..48b3b18a48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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...")
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)
# Ninja requires custom command byproducts to be explicit
cmake_policy(SET CMP0058 OLD)
@@ -34,6 +28,7 @@ set(CMAKE_SHARED_MODULE_PREFIX "")
set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE)
set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE)
set(CMAKE_COLOR_MAKEFILE OFF)
+set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
#set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
if(NOT DEFINED NEW_STYLE_BUILD)
@@ -65,8 +60,8 @@ include(sdk/cmake/compilerflags.cmake)
add_definitions(-D__REACTOS__)
# 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_BINARY_DIR="\\\"${REACTOS_BINARY_DIR}\\\"")
+add_definitions(-DREACTOS_SOURCE_DIR="${REACTOS_SOURCE_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.
file(RELATIVE_PATH _PATH_PREFIX ${REACTOS_BINARY_DIR} ${REACTOS_SOURCE_DIR})
diff --git a/dll/win32/urlmon/CMakeLists.txt b/dll/win32/urlmon/CMakeLists.txt
index 6c7938ff35..ef9c5377ab 100644
--- a/dll/win32/urlmon/CMakeLists.txt
+++ b/dll/win32/urlmon/CMakeLists.txt
@@ -4,8 +4,7 @@ add_definitions(
-D_URLMON_
-DENTRY_PREFIX=URLMON_
-DPROXY_DELEGATION
- -DWINE_REGISTER_DLL
-
-DPROXY_CLSID_IS="{0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}")
+ -DWINE_REGISTER_DLL)
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
spec2def(urlmon.dll urlmon.spec ADD_IMPORTLIB)
diff --git a/dll/win32/urlmon/urlmon_main.h b/dll/win32/urlmon/urlmon_main.h
index 39dbe2f572..e28b351cb3 100644
--- a/dll/win32/urlmon/urlmon_main.h
+++ b/dll/win32/urlmon/urlmon_main.h
@@ -24,6 +24,10 @@
#define COBJMACROS
+#ifdef __REACTOS__
+#define PROXY_CLSID_IS
{0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}
+#endif
+
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
diff --git a/sdk/cmake/compilerflags.cmake b/sdk/cmake/compilerflags.cmake
index 3928b793f3..669a4ff1df 100644
--- a/sdk/cmake/compilerflags.cmake
+++ b/sdk/cmake/compilerflags.cmake
@@ -5,7 +5,7 @@
# while others require space-separated strings. The function has a list of
# properties of the former variety and handles the values accordingly
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 "")
get_target_property(_oldvalue ${_module} ${_propname})
if(_oldvalue)
diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake
index 8ecc06b710..220e868067 100644
--- a/sdk/cmake/gcc.cmake
+++ b/sdk/cmake/gcc.cmake
@@ -61,10 +61,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_COMPILE_OPTIONS_PIC "")
set(CMAKE_C_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_C_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_DEBUG "")
@@ -103,14 +99,6 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
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
if(ARCH STREQUAL "i386")
add_compile_flags("-march=${OARCH} -mtune=${TUNE}")