[cmake] Use CMake property for symbol visibility
CMake provides a target property to set default symbol visibility which supports different toolchains transparently.
This commit is contained in:
parent
3805888a57
commit
98aa694422
1 changed files with 1 additions and 2 deletions
|
|
@ -234,10 +234,9 @@ endfunction()
|
||||||
function(glslang_only_export_explicit_symbols target)
|
function(glslang_only_export_explicit_symbols target)
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
target_compile_definitions(${target} PUBLIC "GLSLANG_IS_SHARED_LIBRARY=1")
|
target_compile_definitions(${target} PUBLIC "GLSLANG_IS_SHARED_LIBRARY=1")
|
||||||
|
set_target_properties(${target} PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_compile_definitions(${target} PRIVATE "GLSLANG_EXPORTING=1")
|
target_compile_definitions(${target} PRIVATE "GLSLANG_EXPORTING=1")
|
||||||
else()
|
|
||||||
target_compile_options(${target} PRIVATE "-fvisibility=hidden")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue