Skip to content

Commit

Permalink
Merge #1526: cmake: Fix check_arm32_assembly when using as subproject
Browse files Browse the repository at this point in the history
9f4c8cd cmake: Fix `check_arm32_assembly` when using as subproject (Hennadii Stepanov)

Pull request description:

  When integrating libsecpk1 in a downstream project like this:
  ```cmake
  set(SECP256K1_ASM arm32 CACHE STRING "" FORCE)
  add_subdirectory(src/secp256k1)
  ```
  it fails to configure:
  ```
  CMake Error at /home/hebasto/git/bitcoin/build/check_arm32_assembly/CMakeFiles/CMakeTmp/CMakeLists.txt:21 (target_sources):
    Cannot find source file:

      /home/hebasto/git/bitcoin/cmake/source_arm32.s

  CMake Error at /home/hebasto/git/bitcoin/build/check_arm32_assembly/CMakeFiles/CMakeTmp/CMakeLists.txt:20 (add_executable):
    No SOURCES given to target: cmTC_d0f0b

  CMake Error at src/secp256k1/cmake/CheckArm32Assembly.cmake:2 (try_compile):
    Failed to generate test project build system.
  Call Stack (most recent call first):
    src/secp256k1/CMakeLists.txt:127 (check_arm32_assembly)

  ```

  This PR fixes this issue, which was overlooked in #1304.

ACKs for top commit:
  real-or-random:
    utACK 9f4c8cd
  theuni:
    utACK 9f4c8cd

Tree-SHA512: 47d97ad0fb2e3779523c2111ea75906671a0fb3f50646e29dee195f53106ace69af5e4abc92c765f0eee6973528ce9195b94377d0157209230c958894d4049fb
  • Loading branch information
real-or-random committed May 9, 2024
2 parents 7712a53 + 9f4c8cd commit 4155e62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/CheckArm32Assembly.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function(check_arm32_assembly)
try_compile(HAVE_ARM32_ASM
${CMAKE_BINARY_DIR}/check_arm32_assembly
SOURCES ${CMAKE_SOURCE_DIR}/cmake/source_arm32.s
${PROJECT_BINARY_DIR}/check_arm32_assembly
SOURCES ${PROJECT_SOURCE_DIR}/cmake/source_arm32.s
)
endfunction()

0 comments on commit 4155e62

Please sign in to comment.