cd1fa537a0
This corresponds to the g++ and clang++ option -fvisibility-inlines-hidden on linux. On Windows with MinGW, this corresponds to -fno-keep-inline-dllexport. That option is not supported by clang currently.
18 lines
602 B
CMake
18 lines
602 B
CMake
|
|
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
|
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
|
|
|
if (CMAKE_CXX_FLAGS MATCHES "-fvisibility=hidden")
|
|
message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory")
|
|
endif()
|
|
if (CMAKE_CXX_FLAGS MATCHES "-fvisibility-inlines-hidden")
|
|
message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory")
|
|
endif()
|
|
|
|
add_library(visibility_preset SHARED visibility_preset.cpp)
|
|
generate_export_header(visibility_preset)
|
|
|
|
add_executable(visibility_preset_exe main.cpp)
|
|
|
|
target_link_libraries(visibility_preset_exe visibility_preset)
|