From b8d90ead9325ea4fb8123a6752197b7428ebde8b Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 6 Oct 2020 15:11:17 +0000 Subject: [PATCH] Move visibility=hidden directive. This CL moves the visibility=hidden directive from the top level applied flags to libtint specifically. This fixes up an issue between SPIRV-Tools and the sample app when using std::rfind which ends up with different visibility. Change-Id: Ib06949b3755db66027d3656d3d6ce2504bfda81e Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29460 Commit-Queue: dan sinclair Commit-Queue: Ryan Harrison Reviewed-by: Ryan Harrison --- CMakeLists.txt | 1 - src/CMakeLists.txt | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79e8a418a7..1c08814ed9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,7 +136,6 @@ function(tint_default_compile_options TARGET) -std=c++14 -fno-exceptions -fno-rtti - -fvisibility=hidden -Wall -Werror -Wextra diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 882b884795..cb04a05523 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -376,6 +376,10 @@ set(TINT_TEST_SRCS ## Tint library add_library(libtint ${TINT_LIB_SRCS}) tint_default_compile_options(libtint) +if (${COMPILER_IS_LIKE_GNU}) + target_compile_options(libtint PRIVATE -fvisibility=hidden) +endif() + set_target_properties(libtint PROPERTIES OUTPUT_NAME "tint") if(${TINT_BUILD_SPV_READER} OR ${TINT_BUILD_SPV_WRITER})