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 <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 79e8a41..1c08814 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,7 +136,6 @@
-std=c++14
-fno-exceptions
-fno-rtti
- -fvisibility=hidden
-Wall
-Werror
-Wextra
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 882b884..cb04a05 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -376,6 +376,10 @@
## 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})