mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-26 13:20:05 +00:00
Added option to only compile spirv library instead of all binaries as well
This commit is contained in:
parent
c978643748
commit
46ba0f7574
@ -117,6 +117,11 @@ add_library(SPIRV-TOOLS ${SPIRV_SOURCES})
|
||||
target_link_libraries(SPIRV-TOOLS ${SPIRV_LIBS})
|
||||
set_target_properties(SPIRV-TOOLS PROPERTIES COMPILE_FLAGS ${SPIRV_WARNINGS})
|
||||
|
||||
option(SPIRV_SKIP_EXECUTABLES "Skip building the executables and tests along with the library" ${SPIRV_SKIP_EXECUTABLES})
|
||||
|
||||
set(SPIRV_BUILT_TARGETS SPIRV-TOOLS)
|
||||
if (NOT ${SPIRV_SKIP_EXECUTABLES})
|
||||
list(APPEND SPIRV_BUILT_TARGETS spirv-as spirv-dis spirv-val)
|
||||
add_executable(spirv-as
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/libspirv/libspirv.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/as/as.cpp)
|
||||
@ -187,9 +192,10 @@ else()
|
||||
message(STATUS "Did not find googletest, tests will not be built."
|
||||
"To enable tests place googletest in '<spirv-dir>/external/googletest'.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install)
|
||||
install(TARGETS SPIRV-TOOLS spirv-as spirv-dis spirv-val
|
||||
install(TARGETS ${SPIRV_BUILT_TARGETS}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
|
Loading…
Reference in New Issue
Block a user