aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-07-06 18:14:03 +0200
committerRiccardo Spagni <ric@spagni.net>2016-07-06 18:14:03 +0200
commit65df33fb0670859c531f09838642fb5e4f5dad9d (patch)
tree133dbb4b070e9558cc912d4617e73604f284de8e /CMakeLists.txt
parentMerge pull request #876 (diff)
parentmakefile: remove unnecessary ARM-specific targets (diff)
downloadmonero-65df33fb0670859c531f09838642fb5e4f5dad9d.tar.xz
Merge pull request #877
ecd0f2d makefile: remove unnecessary ARM-specific targets (redfish) c650160 cmake: disable AES on ARM (redfish) 804b1bc cmake: initialize ARCH for native builds (redfish) bb39034 cmake: remove repetitive code in handling of NO_AES (redfish)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt24
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)