https://git.reactos.org/?p=reactos.git;a=commitdiff;h=979972b9008001c5125b7…
commit 979972b9008001c5125b71d7496ec7206769f170
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Sat Apr 6 13:22:50 2019 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Sat Apr 6 17:43:38 2019 +0200
[CMAKE] unset EXPORT_SYMBOL for modules and shared libraries
We don't use that
---
ntoskrnl/CMakeLists.txt | 1 +
sdk/cmake/CMakeMacros.cmake | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt
index d1ee38201d..3111893fb0 100644
--- a/ntoskrnl/CMakeLists.txt
+++ b/ntoskrnl/CMakeLists.txt
@@ -19,6 +19,7 @@ add_executable(ntoskrnl
ntoskrnl.rc
${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl.def)
set_property(TARGET ntoskrnl PROPERTY ENABLE_EXPORTS TRUE)
+set_target_properties(ntoskrnl PROPERTIES DEFINE_SYMBOL "")
if(ARCH STREQUAL "i386")
set_entrypoint(ntoskrnl KiSystemStartup 4)
diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake
index 70d146d97a..b8fe5ad4db 100644
--- a/sdk/cmake/CMakeMacros.cmake
+++ b/sdk/cmake/CMakeMacros.cmake
@@ -524,6 +524,11 @@ if(NOT MSVC_IDE)
function(add_library name)
_add_library(${name} ${ARGN})
add_clean_target(${name})
+ # cmake adds a module_EXPORTS define when compiling a module or a shared library.
We don't use that.
+ get_target_property(_type ${name} TYPE)
+ if (_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY)
+ set_target_properties(${name} PROPERTIES DEFINE_SYMBOL "")
+ endif()
endfunction()
function(add_executable name)
@@ -549,6 +554,11 @@ elseif(USE_FOLDER_STRUCTURE)
string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1
CMAKE_CURRENT_SOURCE_DIR_RELATIVE)
set_property(TARGET "${name}" PROPERTY FOLDER
"${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}")
endif()
+ # cmake adds a module_EXPORTS define when compiling a module or a shared library.
We don't use that.
+ get_target_property(_type ${name} TYPE)
+ if (_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY)
+ set_target_properties(${name} PROPERTIES DEFINE_SYMBOL "")
+ endif()
endfunction()
function(add_executable name)
@@ -556,6 +566,15 @@ elseif(USE_FOLDER_STRUCTURE)
string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1
CMAKE_CURRENT_SOURCE_DIR_RELATIVE)
set_property(TARGET "${name}" PROPERTY FOLDER
"${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}")
endfunction()
+else()
+ function(add_library name)
+ _add_library(${name} ${ARGN})
+ # cmake adds a module_EXPORTS define when compiling a module or a shared library.
We don't use that.
+ get_target_property(_type ${name} TYPE)
+ if (_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY)
+ set_target_properties(${name} PROPERTIES DEFINE_SYMBOL "")
+ endif()
+ endfunction()
endif()
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")