diff options
author | Morris Hafner <mmha@users.noreply.github.com> | 2019-04-16 08:34:07 +0300 |
---|---|---|
committer | onqtam <vik.kirilov@gmail.com> | 2019-05-06 11:44:36 +0300 |
commit | f9d5d6a66ec810ab7bc130fae6a34f7a91544986 (patch) | |
tree | 98f6efeea29c3e58aebd576c42ab4c97396b7c56 /CMakeLists.txt | |
parent | 06e8d3f213f0f82d8c892c1b6710244956934945 (diff) |
Remove architecture check from CMake package (#225)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1719cacc..89b9b86e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,9 +87,19 @@ set(targets_export_name "${PROJECT_NAME}Targets") set(namespace "${PROJECT_NAME}::") include(CMakePackageConfigHelpers) + +# CMake automatically adds an architecture compatibility check to make sure +# 32 and 64 bit code is not accidentally mixed. For a header-only library this +# is not required. The check can be disabled by temporarily unsetting +# CMAKE_SIZEOF_VOID_P. In CMake 3.14 and later this can be achieved more cleanly +# with write_basic_package_version_file(ARCH_INDEPENDENT). +# TODO: Use this once a newer CMake can be required. +set(DOCTEST_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}) +unset(CMAKE_SIZEOF_VOID_P) write_basic_package_version_file( "${version_config}" VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion ) +set(CMAKE_SIZEOF_VOID_P ${DOCTEST_SIZEOF_VOID_P}) configure_file("scripts/cmake/Config.cmake.in" "${project_config}" @ONLY) |