Skip to content

Commit 2396044

Browse files
authored
MONGOCRYPT-849 do not propagate -fPIC (#1079)
do not propagate `-fPIC`
1 parent 8ef0dfd commit 2396044

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ add_library (mongocrypt_static STATIC ${MONGOCRYPT_SOURCES})
305305
# the common case that users are setting -DCMAKE_C_FLAGS='-fPIC'
306306
string (FIND "${CMAKE_C_FLAGS}" "-fPIC" FPIC_LOCATION)
307307
if (NOT WIN32 AND ENABLE_PIC AND "${FPIC_LOCATION}" EQUAL "-1")
308-
target_compile_options (mongocrypt_static PUBLIC -fPIC)
308+
set_property (TARGET mongocrypt_static PROPERTY POSITION_INDEPENDENT_CODE TRUE)
309309
message ("Adding -fPIC to compilation of mongocrypt_static components")
310310
endif ()
311311
target_include_directories (

kms-message/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ add_library (
100100

101101
string(FIND "${CMAKE_C_FLAGS}" "-fPIC" FPIC_LOCATION)
102102
if (NOT WIN32 AND ENABLE_PIC AND "${FPIC_LOCATION}" EQUAL "-1")
103-
target_compile_options (kms_message_static PUBLIC -fPIC)
103+
set_property (TARGET kms_message_static PROPERTY POSITION_INDEPENDENT_CODE TRUE)
104104
message ("Adding -fPIC to compilation of kms_message_static components")
105105
endif ()
106106

0 commit comments

Comments
 (0)