aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authoranon <anon [at] nowhere>2021-04-27 12:06:42 +0000
committerselsta <selsta@sent.at>2021-07-13 08:00:22 +0200
commitdf40d1dc737a6393eedfc72e3a660daaa6114db3 (patch)
tree22f215a38e90f9c7ea38300d366c1606d390c3bb /CMakeLists.txt
parentcmake: fix undefined symbols and multiple definitions (diff)
downloadmonero-df40d1dc737a6393eedfc72e3a660daaa6114db3.tar.xz
cmake: export all symbols
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a932d28e..339609e8c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -234,6 +234,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}")