Skip to content

Commit

Permalink
Check compiler flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dnzbk committed Dec 3, 2024
1 parent 534665f commit e244c93
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
endif()

include(ExternalProject)
include(CheckCXXCompilerFlag)
15 changes: 10 additions & 5 deletions lib/sources.cmake
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions linux/build-nzbget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e244c93

Please sign in to comment.