aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranon <anon [at] nowhere>2021-04-27 12:06:42 +0000
committerselsta <selsta@sent.at>2021-07-13 08:01:26 +0200
commitec6ff0d002820d63f0d82a08b5ef15dd6b18c818 (patch)
treed2c731331c0d6ac02c44c7bb91f758dd476733d2
parentcmake: fix undefined symbols and multiple definitions (diff)
downloadmonero-ec6ff0d002820d63f0d82a08b5ef15dd6b18c818.tar.xz
cmake: export all symbols
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 883fe4d43..494abb295 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,6 +157,18 @@ add_library(l3 OBJECT incorrect_source.cpp)
endfunction()
forbid_undefined_symbols()
+if (MINGW)
+ function(export_all_symbols)
+ unset(TMP)
+ add_linker_flag_if_supported(-Wl,--export-all-symbols TMP)
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS ${TMP})
+ string(APPEND CMAKE_MODULE_LINKER_FLAGS ${TMP})
+ set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} PARENT_SCOPE)
+ set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS} PARENT_SCOPE)
+ endfunction()
+ export_all_symbols()
+endif()
+
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
message(STATUS "Setting default build type: ${CMAKE_BUILD_TYPE}")