@@ -40,27 +40,27 @@ endif()
40
40
41
41
option (SECP256K1_ENABLE_MODULE_ECDH "Enable ECDH module." ON )
42
42
if (SECP256K1_ENABLE_MODULE_ECDH)
43
- add_definitions (-DENABLE_MODULE_ECDH =1)
43
+ add_compile_definitions (ENABLE_MODULE_ECDH =1)
44
44
endif ()
45
45
46
46
option (SECP256K1_ENABLE_MODULE_RECOVERY "Enable ECDSA pubkey recovery module." OFF )
47
47
if (SECP256K1_ENABLE_MODULE_RECOVERY)
48
- add_definitions (-DENABLE_MODULE_RECOVERY =1)
48
+ add_compile_definitions (ENABLE_MODULE_RECOVERY =1)
49
49
endif ()
50
50
51
51
option (SECP256K1_ENABLE_MODULE_EXTRAKEYS "Enable extrakeys module." ON )
52
52
option (SECP256K1_ENABLE_MODULE_SCHNORRSIG "Enable schnorrsig module." ON )
53
53
if (SECP256K1_ENABLE_MODULE_SCHNORRSIG)
54
54
set (SECP256K1_ENABLE_MODULE_EXTRAKEYS ON )
55
- add_definitions (-DENABLE_MODULE_SCHNORRSIG =1)
55
+ add_compile_definitions (ENABLE_MODULE_SCHNORRSIG =1)
56
56
endif ()
57
57
if (SECP256K1_ENABLE_MODULE_EXTRAKEYS)
58
- add_definitions (-DENABLE_MODULE_EXTRAKEYS =1)
58
+ add_compile_definitions (ENABLE_MODULE_EXTRAKEYS =1)
59
59
endif ()
60
60
61
61
option (SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS "Enable external default callback functions." OFF )
62
62
if (SECP256K1_USE_EXTERNAL_DEFAULT_CALLBACKS)
63
- add_definitions (-DUSE_EXTERNAL_DEFAULT_CALLBACKS =1)
63
+ add_compile_definitions (USE_EXTERNAL_DEFAULT_CALLBACKS =1)
64
64
endif ()
65
65
66
66
set (SECP256K1_ECMULT_WINDOW_SIZE "AUTO" CACHE STRING "Window size for ecmult precomputation for verification, specified as integer in range [2..24]. \" AUTO\" is a reasonable setting for desktop machines (currently 15). [default=AUTO]" )
@@ -70,22 +70,22 @@ check_string_option_value(SECP256K1_ECMULT_WINDOW_SIZE)
70
70
if (SECP256K1_ECMULT_WINDOW_SIZE STREQUAL "AUTO" )
71
71
set (SECP256K1_ECMULT_WINDOW_SIZE 15)
72
72
endif ()
73
- add_definitions (-DECMULT_WINDOW_SIZE =${SECP256K1_ECMULT_WINDOW_SIZE} )
73
+ add_compile_definitions (ECMULT_WINDOW_SIZE =${SECP256K1_ECMULT_WINDOW_SIZE} )
74
74
75
75
set (SECP256K1_ECMULT_GEN_PREC_BITS "AUTO" CACHE STRING "Precision bits to tune the precomputed table size for signing, specified as integer 2, 4 or 8. \" AUTO\" is a reasonable setting for desktop machines (currently 4). [default=AUTO]" )
76
76
set_property (CACHE SECP256K1_ECMULT_GEN_PREC_BITS PROPERTY STRINGS "AUTO" 2 4 8)
77
77
check_string_option_value(SECP256K1_ECMULT_GEN_PREC_BITS)
78
78
if (SECP256K1_ECMULT_GEN_PREC_BITS STREQUAL "AUTO" )
79
79
set (SECP256K1_ECMULT_GEN_PREC_BITS 4)
80
80
endif ()
81
- add_definitions (-DECMULT_GEN_PREC_BITS =${SECP256K1_ECMULT_GEN_PREC_BITS} )
81
+ add_compile_definitions (ECMULT_GEN_PREC_BITS =${SECP256K1_ECMULT_GEN_PREC_BITS} )
82
82
83
83
set (SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY "OFF" CACHE STRING "Test-only override of the (autodetected by the C code) \" widemul\" setting. Legal values are: \" OFF\" , \" int128_struct\" , \" int128\" or \" int64\" . [default=OFF]" )
84
84
set_property (CACHE SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY PROPERTY STRINGS "OFF" "int128_struct" "int128" "int64" )
85
85
check_string_option_value(SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY)
86
86
if (SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY)
87
87
string (TOUPPER "${SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY} " widemul_upper_value)
88
- add_definitions (-DUSE_FORCE_WIDEMUL_ ${widemul_upper_value} =1)
88
+ add_compile_definitions (USE_FORCE_WIDEMUL_ ${widemul_upper_value} =1)
89
89
endif ()
90
90
mark_as_advanced (FORCE SECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY)
91
91
@@ -94,13 +94,13 @@ set_property(CACHE SECP256K1_ASM PROPERTY STRINGS "AUTO" "OFF" "x86_64" "arm")
94
94
check_string_option_value(SECP256K1_ASM)
95
95
if (SECP256K1_ASM STREQUAL "arm" )
96
96
enable_language (ASM)
97
- add_definitions (-DUSE_EXTERNAL_ASM =1)
97
+ add_compile_definitions (USE_EXTERNAL_ASM =1)
98
98
elseif (SECP256K1_ASM)
99
99
include (Check64bitAssembly)
100
100
check_64bit_assembly()
101
101
if (HAS_64BIT_ASM)
102
102
set (SECP256K1_ASM "x86_64" )
103
- add_definitions (-DUSE_ASM_X86_64 =1)
103
+ add_compile_definitions (USE_ASM_X86_64 =1)
104
104
elseif (SECP256K1_ASM STREQUAL "AUTO" )
105
105
set (SECP256K1_ASM "OFF" )
106
106
else ()
@@ -123,7 +123,7 @@ if(SECP256K1_VALGRIND)
123
123
if (Valgrind_FOUND)
124
124
set (SECP256K1_VALGRIND ON )
125
125
include_directories (${Valgrind_INCLUDE_DIR} )
126
- add_definitions (-DVALGRIND )
126
+ add_compile_definitions (VALGRIND )
127
127
elseif (SECP256K1_VALGRIND STREQUAL "AUTO" )
128
128
set (SECP256K1_VALGRIND OFF )
129
129
else ()
0 commit comments