build: use ARCH 'native' by default, allow to configure and override it

This commit is contained in:
xiphon 2018-10-13 09:46:19 +00:00
parent 77e1ebff26
commit bf842a6a1e
3 changed files with 6 additions and 6 deletions

View file

@ -58,7 +58,7 @@ script:
- export TRAVIS_COMMIT_LOG=`git log --format=fuller -1` - export TRAVIS_COMMIT_LOG=`git log --format=fuller -1`
- OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST
- if [ -z "$NO_DEPENDS" ]; then $DOCKER_EXEC ccache --max-size=$CCACHE_SIZE; fi - if [ -z "$NO_DEPENDS" ]; then $DOCKER_EXEC ccache --max-size=$CCACHE_SIZE; fi
- $DOCKER_EXEC bash -c "mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/contrib/depends/$HOST/share/toolchain.cmake .. && make $MAKEJOBS" - $DOCKER_EXEC bash -c "mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/contrib/depends/$HOST/share/toolchain.cmake -DTRAVIS=true .. && make $MAKEJOBS"
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/contrib/depends/$HOST/lib - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/contrib/depends/$HOST/lib
after_script: after_script:
- echo $TRAVIS_COMMIT_RANGE - echo $TRAVIS_COMMIT_RANGE

View file

@ -40,6 +40,7 @@ if (IOS)
endif() endif()
cmake_minimum_required(VERSION 2.8.7) cmake_minimum_required(VERSION 2.8.7)
message(STATUS "CMake version ${CMAKE_VERSION}")
project(monero) project(monero)
@ -139,7 +140,6 @@ if(ARCH_ID STREQUAL "ppc64le")
set(PPC64LE 1) set(PPC64LE 1)
set(PPC64 0) set(PPC64 0)
set(PPC 0) set(PPC 0)
endif() endif()
if(ARCH_ID STREQUAL "powerpc64" OR ARCH_ID STREQUAL "ppc64") if(ARCH_ID STREQUAL "powerpc64" OR ARCH_ID STREQUAL "ppc64")
@ -517,11 +517,9 @@ if(MSVC)
include_directories(SYSTEM src/platform/msc) include_directories(SYSTEM src/platform/msc)
else() else()
include(TestCXXAcceptsFlag) include(TestCXXAcceptsFlag)
if (NOT ARM6) if (NOT ARCH)
if(NOT DEPENDS OR DEPENDS AND NOT ARM)
set(ARCH native CACHE STRING "CPU to build for: -march value or 'default' to not pass -march at all") set(ARCH native CACHE STRING "CPU to build for: -march value or 'default' to not pass -march at all")
endif() endif()
endif()
message(STATUS "Building on ${CMAKE_SYSTEM_PROCESSOR} for ${ARCH}") message(STATUS "Building on ${CMAKE_SYSTEM_PROCESSOR} for ${ARCH}")
if(ARCH STREQUAL "default") if(ARCH STREQUAL "default")
set(ARCH_FLAG "") set(ARCH_FLAG "")

View file

@ -51,7 +51,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET(APPLE True) SET(APPLE True)
SET(BUILD_TAG "mac-x64") SET(BUILD_TAG "mac-x64")
SET(BUILD_64 ON) SET(BUILD_64 ON)
if(NOT TRAVIS)
SET(ARCH "x86_64") SET(ARCH "x86_64")
endif()
SET(BREW OFF) SET(BREW OFF)
SET(PORT OFF) SET(PORT OFF)
SET(CMAKE_OSX_SYSROOT "@sdk@/MacOSX10.11.sdk/") SET(CMAKE_OSX_SYSROOT "@sdk@/MacOSX10.11.sdk/")