cmake: Fix symbol visibility on Linux.

Use the correct cmake property to set hidden visibility for shared
libraries.
This commit is contained in:
Arcady Goldmints-Orlov 2024-09-18 12:39:16 -04:00 committed by arcady-lunarg
parent ec7e23f458
commit 3dde7d5fa8

View file

@ -267,7 +267,8 @@ 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) set_target_properties(${target} PROPERTIES CXX_VISIBILITY_PRESET hidden)
set_target_properties(${target} PROPERTIES C_VISIBILITY_PRESET hidden)
if(WIN32) if(WIN32)
target_compile_definitions(${target} PRIVATE "GLSLANG_EXPORTING=1") target_compile_definitions(${target} PRIVATE "GLSLANG_EXPORTING=1")
endif() endif()