[CMAKE] unset EXPORT_SYMBOL for modules and shared libraries

We don't use that
This commit is contained in:
Jérôme Gardou 2019-04-06 13:22:50 +02:00 committed by Jérôme Gardou
parent 23373acbb9
commit 979972b900
2 changed files with 20 additions and 0 deletions

View file

@ -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)

View file

@ -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")