diff --git a/cmake/common.cmake b/cmake/common.cmake index 8fe927ca..337c9ced 100644 --- a/cmake/common.cmake +++ b/cmake/common.cmake @@ -22,3 +22,4 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Release") endif() include(ExternalProject) +include(CheckCXXCompilerFlag) diff --git a/lib/sources.cmake b/lib/sources.cmake index 3715757d..2a29b0a3 100644 --- a/lib/sources.cmake +++ b/lib/sources.cmake @@ -1,12 +1,17 @@ +CHECK_CXX_COMPILER_FLAG("-mfpu=neon -march=armv7-a" COMPILER_SUPPORTS_ARM32_NEON) +if(COMPILER_SUPPORTS_ARM32_NEON) + set(NEON_CXXFLAGS "-mfpu=neon") +endif() + +CHECK_CXX_COMPILER_FLAG("-march=armv8-a+crc -fpermissive" COMPILER_SUPPORTS_ARM_CRC) +if(COMPILER_SUPPORTS_ARM_CRC) + set(ACLECRC_CXXFLAGS "-march=armv8-a+crc -fpermissive") +endif() + if(CMAKE_SYSTEM_PROCESSOR MATCHES "i?86|x86_64") set(SSE2_CXXFLAGS "-msse2") set(SSSE3_CXXFLAGS "-mssse3") set(PCLMUL_CXXFLAGS "-msse4.1 -mpclmul") -elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") - set(ACLECRC_CXXFLAGS "-march=armv8-a+crc -fpermissive") -elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*") - set(NEON_CXXFLAGS "-mfpu=neon") - set(ACLECRC_CXXFLAGS "-march=armv8-a+crc -fpermissive") endif() add_library(regex STATIC diff --git a/linux/build-nzbget.sh b/linux/build-nzbget.sh index b5346862..2b38a861 100755 --- a/linux/build-nzbget.sh +++ b/linux/build-nzbget.sh @@ -29,7 +29,7 @@ COREX=4 TESTING="no" # build variables -ALL_ARCHS="armel armhf aarch64 i686 x86_64 riscv64 mipsel mipseb ppc500 ppc6xx i686-ndk x86_64-ndk armhf-ndk aarch64-ndk x86_64-bsd" +ALL_ARCHS="armel" ALL_PLATFORMS="linux android freebsd" OUTPUTDIR=build BUILDROOT_HOME=/build @@ -666,7 +666,7 @@ build_bin() -DCMAKE_SYSTEM_PROCESSOR=$CMAKE_SYSTEM_PROCESSOR \ -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake \ -DENABLE_STATIC=ON \ - -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \ + -DCMAKE_BUILD_TYPE=Debug \ -DVERSION_SUFFIX=$VERSION_SUFFIX \ -DCMAKE_INSTALL_PREFIX=$NZBGET_ROOT/$OUTPUTDIR/install/$ARCH \ $CMAKE_EXTRA_ARGS