diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e7806fa1..6b9c81895 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,12 @@ function (die msg) message(FATAL_ERROR "${BoldRed}${msg}${ColourReset}") endfunction () -if (NOT ${ARCH} STREQUAL "") +if ("${ARCH}" STREQUAL "" OR "${ARCH}" STREQUAL "native") + set(ARCH ${CMAKE_SYSTEM_PROCESSOR}) + message(STATUS "Building natively on ${ARCH}") +endif() + +if (NOT "${ARCH}" STREQUAL "") string(SUBSTRING ${ARCH} 0 3 IS_ARM) string(TOLOWER ${IS_ARM} IS_ARM) @@ -342,16 +347,19 @@ else() set(STATIC_ASSERT_FLAG "-Dstatic_assert=_Static_assert") endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG}") + option(NO_AES "Explicitly disable AES support" ${NO_AES}) - if (NO_AES) - message(STATUS "Disabling AES support") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG}") + if(NOT NO_AES AND NOT (ARM6 OR ARM7)) + message(STATUS "AES support enabled") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes") + elseif(ARM7 OR ARM6) + message(STATUS "AES support disabled (not available on ARM)") else() - message(STATUS "Enabling AES support") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG} -maes") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG} -maes") + message(STATUS "AES support disabled") endif() if(ARM6) |