From d9234dee3c8e9f5ee4c5ab4223f9d0e8b725fa6c Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Thu, 7 Apr 2022 13:27:01 +0200 Subject: build: use ARCH_INDEPENDENT if possible Since this is a header-only library, the CMake Version file should be marked architecture-independent with the ARCH_INDEPENDENT option. As the option has been added in CMake 3.14 and spriv-headers supports CMake 3.0 the option has to be passed only if supported. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f19390a..147f7ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,9 +89,14 @@ if (SPIRV_HEADERS_ENABLE_INSTALL) set(namespace "${PROJECT_NAME}::") include(CMakePackageConfigHelpers) + + if (NOT CMAKE_VERSION VERSION_LESS 3.14) + set(arch_independent_str ARCH_INDEPENDENT) + endif() write_basic_package_version_file( "${version_config}" COMPATIBILITY SameMajorVersion + ${arch_independent_str} ) configure_package_config_file( -- cgit v1.2.3 From 539b239841bf049f82f4abf6baf5fabefef4e7fd Mon Sep 17 00:00:00 2001 From: Jeremy Hayes Date: Wed, 27 Jul 2022 13:56:30 -0600 Subject: Remove custom target if skipping install Fix #271. --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 147f7ad..9cfba73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,11 +44,6 @@ project(SPIRV-Headers VERSION 1.5.5) # 2. cmake .. # 3. cmake --build . --target install -# legacy -add_custom_target(install-headers - COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv - $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/include/spirv) - option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" ${SPIRV_HEADERS_SKIP_EXAMPLES}) @@ -61,6 +56,10 @@ endif() if(NOT ${SPIRV_HEADERS_SKIP_INSTALL}) set(SPIRV_HEADERS_ENABLE_INSTALL ON) + # legacy + add_custom_target(install-headers + COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv + $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/include/spirv) endif() if (SPIRV_HEADERS_ENABLE_EXAMPLES) -- cgit v1.2.3