build: add CMake option for disabling symbol visibility attributes
Co-authored-by: Tim Ruffing <me@real-or-random.org>
This commit is contained in:
@@ -42,6 +42,8 @@ endif()
|
|||||||
|
|
||||||
option(SECP256K1_INSTALL "Enable installation." ${PROJECT_IS_TOP_LEVEL})
|
option(SECP256K1_INSTALL "Enable installation." ${PROJECT_IS_TOP_LEVEL})
|
||||||
|
|
||||||
|
option(SECP256K1_ENABLE_API_VISIBILITY_ATTRIBUTES "Enable visibility attributes in the API." ON)
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
|
|
||||||
# We declare all options before processing them, to make sure we can express
|
# We declare all options before processing them, to make sure we can express
|
||||||
@@ -312,6 +314,7 @@ else()
|
|||||||
set(cross_status "FALSE")
|
set(cross_status "FALSE")
|
||||||
endif()
|
endif()
|
||||||
message("Cross compiling ....................... ${cross_status}")
|
message("Cross compiling ....................... ${cross_status}")
|
||||||
|
message("API visibility attributes ............. ${SECP256K1_ENABLE_API_VISIBILITY_ATTRIBUTES}")
|
||||||
message("Valgrind .............................. ${SECP256K1_VALGRIND}")
|
message("Valgrind .............................. ${SECP256K1_VALGRIND}")
|
||||||
get_directory_property(definitions COMPILE_DEFINITIONS)
|
get_directory_property(definitions COMPILE_DEFINITIONS)
|
||||||
string(REPLACE ";" " " definitions "${definitions}")
|
string(REPLACE ";" " " definitions "${definitions}")
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ add_library(secp256k1_precomputed OBJECT EXCLUDE_FROM_ALL
|
|||||||
# from being exported.
|
# from being exported.
|
||||||
target_sources(secp256k1 PRIVATE secp256k1.c $<TARGET_OBJECTS:secp256k1_precomputed>)
|
target_sources(secp256k1 PRIVATE secp256k1.c $<TARGET_OBJECTS:secp256k1_precomputed>)
|
||||||
|
|
||||||
|
if(NOT SECP256K1_ENABLE_API_VISIBILITY_ATTRIBUTES)
|
||||||
|
target_compile_definitions(secp256k1 PRIVATE SECP256K1_NO_API_VISIBILITY_ATTRIBUTES)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Create a helper lib that parent projects can use to link secp256k1 into a
|
# Create a helper lib that parent projects can use to link secp256k1 into a
|
||||||
# static lib.
|
# static lib.
|
||||||
add_library(secp256k1_objs INTERFACE)
|
add_library(secp256k1_objs INTERFACE)
|
||||||
|
|||||||
Reference in New Issue
Block a user