build: use ARCH_INDEPENDENT if possible
authorAndrea Pappacoda <andrea@pappacoda.it>
Thu, 7 Apr 2022 11:27:01 +0000 (13:27 +0200)
committerGitHub <noreply@github.com>
Thu, 7 Apr 2022 11:27:01 +0000 (13:27 +0200)
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

index f19390a..147f7ad 100644 (file)
@@ -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(