bitcoin-core / secp256k1

Optimized C library for EC operations on curve secp256k1
MIT License
2.02k stars 977 forks source link

cmake: Fix `check_arm32_assembly` when using as subproject #1526

Closed hebasto closed 2 months ago

hebasto commented 2 months ago

When integrating libsecpk1 in a downstream project like this:

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 https://github.com/bitcoin-core/secp256k1/pull/1304.

hebasto commented 2 months ago

cc @real-or-random @theuni