Skip to content

Commit

Permalink
Merge #57: cmake: Backport changes from master
Browse files Browse the repository at this point in the history
02392e7 fixup! cmake: Build `crc32c` static library (Hennadii Stepanov)
a682425 fixup! cmake: Check system symbols (Hennadii Stepanov)

Pull request description:

  The first commit fixes a regression, which makes tests running with the empty `CMAKE_REQUIRED_FLAGS` variable. It was introduced during updating the code for the minimum CMake 3.16.

  The second commit mirrors bitcoin#28919.

ACKs for top commit:
  pablomartin4btc:
    tACK 02392e7

Tree-SHA512: 80a8fb13367b3b5be7db2663dc82667400b527c49ea22b4c07abcc916797e0cdbc1348d28bbd02e7b7f4c34f5e7d816947517d3998449e5fa963ba84f8a0690d
  • Loading branch information
hebasto committed Dec 4, 2023
2 parents ccbbe64 + 02392e7 commit 399642a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmake/crc32c.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ check_cxx_source_compiles_with_flags("${SSE42_CXXFLAGS}" "
)

# Check for ARMv8 w/ CRC and CRYPTO extensions support in the compiler.
set(ARM_CRC_CXXFLAGS -march=armv8-a+crc)
set(ARM_CRC_CXXFLAGS -march=armv8-a+crc+crypto)
check_cxx_source_compiles_with_flags("${ARM_CRC_CXXFLAGS}" "
#include <arm_acle.h>
#include <arm_neon.h>
Expand Down
6 changes: 4 additions & 2 deletions cmake/module/CheckSourceCompilesAndLinks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ endmacro()

macro(check_cxx_source_compiles_with_flags flags source)
cmake_push_check_state(RESET)
list(JOIN flags " " CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_FLAGS ${flags})
list(JOIN CMAKE_REQUIRED_FLAGS " " CMAKE_REQUIRED_FLAGS)
check_cxx_source_compiles("${source}" ${ARGN})
cmake_pop_check_state()
endmacro()

macro(check_cxx_source_links_with_flags flags source)
cmake_push_check_state(RESET)
list(JOIN flags " " CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_FLAGS ${flags})
list(JOIN CMAKE_REQUIRED_FLAGS " " CMAKE_REQUIRED_FLAGS)
check_cxx_source_links("${source}" ${ARGN})
cmake_pop_check_state()
endmacro()
Expand Down

0 comments on commit 399642a

Please sign in to comment.