Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,15 @@ else()
set(TINT_DEFAULT_HLSL OFF)
endif()

option(TINT_ENABLE_INSTALL "Enable install step for Tint libraries" OFF)
option(TINT_INSTALL_CMD_TOOLS "Install the Tint command-line tools" OFF)
option(TINT_INSTALL_LIBS "Install the internal Tint libraries and headers" OFF)
option(TINT_ENABLE_INSTALL "Deprecated: sets both TINT_INSTALL_CMD_TOOLS and TINT_INSTALL_LIBS to ON" OFF)
if (TINT_ENABLE_INSTALL)
message(DEPRECATION "TINT_ENABLE_INSTALL is deprecated. Use TINT_INSTALL_CMD_TOOLS "
"and/or TINT_INSTALL_LIBS instead.")
set(TINT_INSTALL_CMD_TOOLS ON)
set(TINT_INSTALL_LIBS ON)
endif()
option(TINT_BUILD_CMD_TOOLS "Build the Tint command line tools" ON)

if (DAWN_BUILD_SAMPLES)
Expand Down Expand Up @@ -339,7 +347,8 @@ message(STATUS "LLVM Source dir: ${LLVM_SOURCE_DIR}")
message(STATUS "")

message(STATUS "Tint build command line executable tools: ${TINT_BUILD_CMD_TOOLS}")
message(STATUS "Tint install: ${TINT_ENABLE_INSTALL}")
message(STATUS "Tint install command-line tools: ${TINT_INSTALL_CMD_TOOLS}")
message(STATUS "Tint install libraries: ${TINT_INSTALL_LIBS}")
message(STATUS "Tint build IR binary: ${TINT_BUILD_IR_BINARY}")
message(STATUS "Tint build fuzzers: ${TINT_BUILD_FUZZERS}")
message(STATUS "Tint build fuzzing vulkan drivers: ${TINT_BUILD_FUZZER_VULKAN_SUPPORT}")
Expand Down
10 changes: 6 additions & 4 deletions src/tint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,22 @@ function(tint_spvtools_compile_options TARGET)
endfunction()

function(tint_lib_compile_options TARGET)
if (TINT_ENABLE_INSTALL)
if (TINT_INSTALL_LIBS)
install(TARGETS ${TARGET}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
OPTIONAL
)
endif()
tint_default_compile_options(${TARGET})
endfunction()

function(tint_proto_compile_options TARGET)
if (TINT_ENABLE_INSTALL)
if (TINT_INSTALL_LIBS)
install(TARGETS ${TARGET}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
OPTIONAL
)
endif()
tint_core_compile_options(${TARGET})
Expand Down Expand Up @@ -421,7 +423,7 @@ function(tint_add_target TARGET KIND)
elseif(${KIND} STREQUAL cmd)
add_executable(${TARGET})
tint_default_compile_options(${TARGET})
if (TINT_ENABLE_INSTALL)
if (TINT_INSTALL_CMD_TOOLS)
install(TARGETS "${TARGET}")
endif()
elseif(${KIND} STREQUAL test_cmd)
Expand Down Expand Up @@ -753,7 +755,7 @@ add_library(libtint ALIAS tint_api)
################################################################################
# Install rules
################################################################################
if (TINT_ENABLE_INSTALL)
if (TINT_INSTALL_LIBS)
# We need to recurse all folders and include all headers because tint.h includes most headers from src/tint
file(GLOB TINT_HEADERS "${DAWN_INCLUDE_DIR}/tint/*.h")

Expand Down
Loading