cmake: Fix regression in `secp256k1.cmake`

The `enable_language` command must be called in file scope, not in a
function call.

See: https://cmake.org/cmake/help/latest/command/enable_language.html

Github-Pull: #33379
Rebased-From: 9193c3e434
This commit is contained in:
Hennadii Stepanov 2025-09-12 17:56:12 +01:00 committed by fanquake
parent 75026cddea
commit 0a2afbeb77
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,8 @@
# Distributed under the MIT software license, see the accompanying # Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/. # file COPYING or https://opensource.org/license/mit/.
enable_language(C)
function(add_secp256k1 subdir) function(add_secp256k1 subdir)
message("") message("")
message("Configuring secp256k1 subtree...") message("Configuring secp256k1 subtree...")
@ -30,7 +32,6 @@ function(add_secp256k1 subdir)
string(STRIP "${SECP256K1_APPEND_LDFLAGS} ${APPEND_LDFLAGS}" SECP256K1_APPEND_LDFLAGS) string(STRIP "${SECP256K1_APPEND_LDFLAGS} ${APPEND_LDFLAGS}" SECP256K1_APPEND_LDFLAGS)
set(SECP256K1_APPEND_LDFLAGS ${SECP256K1_APPEND_LDFLAGS} CACHE STRING "" FORCE) set(SECP256K1_APPEND_LDFLAGS ${SECP256K1_APPEND_LDFLAGS} CACHE STRING "" FORCE)
# We want to build libsecp256k1 with the most tested RelWithDebInfo configuration. # We want to build libsecp256k1 with the most tested RelWithDebInfo configuration.
enable_language(C)
foreach(config IN LISTS CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES) foreach(config IN LISTS CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES)
if(config STREQUAL "") if(config STREQUAL "")
continue() continue()