From 19b7fba235a698fb97d1ad24d14061f3f60621e0 Mon Sep 17 00:00:00 2001 From: SachinVin Date: Sat, 20 Jul 2019 08:41:42 +0530 Subject: [PATCH] CMakeModules\DetectArchitecture.cmake: Refactor `ARCHITECTURE` to `DYNARMIC_ARCHITECTURE` Don't rely on super-project's definition of ARCHITECTURE --- CMakeLists.txt | 4 ++-- CMakeModules/DetectArchitecture.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb1e696a..2e627155 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,10 +105,10 @@ else() detect_architecture("__x86_64__" x86_64) detect_architecture("__aarch64__" Aarch64) endif() -if (NOT DEFINED ARCHITECTURE) +if (NOT DEFINED DYNARMIC_ARCHITECTURE) message(FATAL_ERROR "Unsupported architecture encountered. Ending CMake generation.") endif() -message(STATUS "Target architecture: ${ARCHITECTURE}") +message(STATUS "Target architecture: ${DYNARMIC_ARCHITECTURE}") # Include Boost if (NOT TARGET boost) diff --git a/CMakeModules/DetectArchitecture.cmake b/CMakeModules/DetectArchitecture.cmake index e984c6b8..5978061a 100644 --- a/CMakeModules/DetectArchitecture.cmake +++ b/CMakeModules/DetectArchitecture.cmake @@ -1,6 +1,6 @@ include(CheckSymbolExists) function(detect_architecture symbol arch) - if (NOT DEFINED ARCHITECTURE) + if (NOT DEFINED DYNARMIC_ARCHITECTURE) set(CMAKE_REQUIRED_QUIET 1) check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch}) unset(CMAKE_REQUIRED_QUIET) @@ -8,7 +8,7 @@ function(detect_architecture symbol arch) # The output variable needs to be unique across invocations otherwise # CMake's crazy scope rules will keep it defined if (ARCHITECTURE_${arch}) - set(ARCHITECTURE "${arch}" PARENT_SCOPE) + set(DYNARMIC_ARCHITECTURE "${arch}" PARENT_SCOPE) set(ARCHITECTURE_${arch} 1 PARENT_SCOPE) add_definitions(-DARCHITECTURE_${arch}=1) endif()