Skip to content

Commit

Permalink
cmake: Add REDUCE_EXPORTS option
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jun 8, 2022
1 parent 4d54350 commit 4b2ffe8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ if(USE_CCACHE)
endif()
endif()

option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting executables" OFF)
if(REDUCE_EXPORTS)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
link_libraries(-Wl,--exclude-libs,ALL)
endif()

if(WIN32)
add_compile_definitions(_MT WIN32 _WINDOWS _WIN32_WINNT=0x0601 _WIN32_IE=0x0501 WIN32_LEAN_AND_MEAN)
link_libraries(-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1)
Expand Down

0 comments on commit 4b2ffe8

Please sign in to comment.