cmake: Always build Tint as a static library
The shared library build of Tint is currently broken with CMake, since
we set -fvisibility=hidden and do not export any of Tint's publicly
used APIs.
Change-Id: I63518fbd13e2adbf17aba79114c66d1567b8268b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75780
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index c20fbbf..ab6ffab 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -56,7 +56,12 @@
# building the GLSL writer, but currently Dawn does not provide this
# third_party dependency. Disable the GLSL writer for now.
set(TINT_BUILD_GLSL_WRITER OFF)
+ # TODO(crbug.com/tint/455): Tint does not currently build with CMake when
+ # BUILD_SHARED_LIBS=1, so always build it as static for now.
+ set(BUILD_SHARED_LIBS_SAVED ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS 0)
add_subdirectory(${DAWN_TINT_DIR} "${CMAKE_CURRENT_BINARY_DIR}/tint")
+ set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_SAVED})
endif()
if (NOT TARGET libabsl)