diff --git a/CMakeLists.txt b/CMakeLists.txt index 3985a5fca3..ca7501de0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,18 +89,18 @@ if (${TINT_BUILD_SPIRV_TOOLS_FUZZER}) message(STATUS "TINT_BUILD_SPIRV_TOOLS_FUZZER is ON - setting TINT_BUILD_FUZZERS TINT_BUILD_SPV_READER + TINT_BUILD_SPV_WRITER TINT_BUILD_WGSL_READER TINT_BUILD_WGSL_WRITER TINT_BUILD_HLSL_WRITER - TINT_BUILD_MSL_WRITER - TINT_BUILD_SPV_WRITER to ON") - set(TINT_BUILD_FUZZERS ON) - set(TINT_BUILD_SPV_READER ON) - set(TINT_BUILD_WGSL_READER ON) - set(TINT_BUILD_WGSL_WRITER ON) - set(TINT_BUILD_HLSL_WRITER ON) - set(TINT_BUILD_MSL_WRITER ON) - set(TINT_BUILD_SPV_WRITER ON) + TINT_BUILD_MSL_WRITER to ON") + set(TINT_BUILD_FUZZERS ON CACHE BOOL "Build tint fuzzers" FORCE) + set(TINT_BUILD_SPV_READER ON CACHE BOOL "Build SPIR-V reader" FORCE) + set(TINT_BUILD_SPV_WRITER ON CACHE BOOL "Build SPIR-V writer" FORCE) + set(TINT_BUILD_WGSL_READER ON CACHE BOOL "Build WGSL reader" FORCE) + set(TINT_BUILD_WGSL_WRITER ON CACHE BOOL "Build WGSL writer" FORCE) + set(TINT_BUILD_HLSL_WRITER ON CACHE BOOL "Build HLSL writer" FORCE) + set(TINT_BUILD_MSL_WRITER ON CACHE BOOL "Build MSL writer" FORCE) endif() if (${TINT_BUILD_AST_FUZZER}) @@ -111,12 +111,12 @@ if (${TINT_BUILD_AST_FUZZER}) TINT_BUILD_SPV_WRITER TINT_BUILD_MSL_WRITER TINT_BUILD_HLSL_WRITER to ON") - set(TINT_BUILD_FUZZERS ON) - set(TINT_BUILD_WGSL_READER ON) - set(TINT_BUILD_WGSL_WRITER ON) - set(TINT_BUILD_SPV_WRITER ON) - set(TINT_BUILD_MSL_WRITER ON) - set(TINT_BUILD_HLSL_WRITER ON) + set(TINT_BUILD_FUZZERS ON CACHE BOOL "Build tint fuzzers" FORCE) + set(TINT_BUILD_WGSL_READER ON CACHE BOOL "Build WGSL reader" FORCE) + set(TINT_BUILD_WGSL_WRITER ON CACHE BOOL "Build WGSL writer" FORCE) + set(TINT_BUILD_SPV_WRITER ON CACHE BOOL "Build SPIR-V writer" FORCE) + set(TINT_BUILD_MSL_WRITER ON CACHE BOOL "Build MSL writer" FORCE) + set(TINT_BUILD_HLSL_WRITER ON CACHE BOOL "Build HLSL writer" FORCE) endif() set(TINT_ROOT_SOURCE_DIR ${PROJECT_SOURCE_DIR}) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index fcf025d9c2..b7e94aac68 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -13,28 +13,28 @@ # limitations under the License. if (${TINT_BUILD_TESTS} AND NOT TARGET gmock) - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + set(gtest_force_shared_crt ON CACHE BOOL "Controls whether a shared run-time library should be used even when Google Test is built as static library" FORCE) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest EXCLUDE_FROM_ALL) endif() if ((${TINT_BUILD_SPIRV_TOOLS_FUZZER} OR ${TINT_BUILD_AST_FUZZER}) AND (NOT TARGET protobuf::libprotobuf OR NOT TARGET protobuf::protoc)) - if (${TINT_BUILD_SPIRV_TOOLS_FUZZER}) - set(SPIRV_BUILD_FUZZER ON CACHE BOOL "Build spirv-fuzz") - endif() - set(protobuf_BUILD_TESTS OFF CACHE BOOL "Disable protobuf tests") - set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Do not build protobuf static runtime") + set(protobuf_BUILD_TESTS OFF CACHE BOOL "Controls whether protobuf tests are built" FORCE) + set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Controls whether a protobuf static runtime is built" FORCE) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/protobuf/cmake) endif() if(${TINT_BUILD_SPV_READER} OR ${TINT_BUILD_SPV_WRITER}) if (NOT IS_DIRECTORY "${SPIRV-Headers_SOURCE_DIR}") - set(SPIRV-Headers_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers CACHE STRING "") + set(SPIRV-Headers_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers CACHE STRING "Source directory for SPIR-V headers") endif() if (NOT TARGET SPIRV-Tools) - set(SPIRV_SKIP_TESTS ON CACHE BOOL ON) - set(SPIRV_WERROR OFF CACHE BOOL OFF) + set(SPIRV_SKIP_TESTS ON CACHE BOOL "Controls whether SPIR-V tests are run" FORCE) + set(SPIRV_WERROR OFF CACHE BOOL OFF FORCE) + if (${TINT_BUILD_SPIRV_TOOLS_FUZZER}) + set(SPIRV_BUILD_FUZZER ON CACHE BOOL "Controls whether spirv-fuzz is built" FORCE) + endif() add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools EXCLUDE_FROM_ALL) endif() endif()