File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
1717
1818include (SwiftSupport)
1919
20- # Fixes error: "requires dynamic R_X86_64_PC32 reloc against 'XXX' which may overflow at runtime"
21- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
22-
2320if (CMAKE_VERSION VERSION_LESS 3.16 AND CMAKE_SYSTEM_NAME STREQUAL Windows)
2421 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
2522 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
@@ -34,6 +31,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows OR CMAKE_SYSTEM_NAME STREQUAL Darwin)
3431 option (BUILD_SHARED_LIBS "Build shared libraries by default" YES )
3532endif ()
3633
34+ if (BUILD_SHARED_LIBS )
35+ set (CMAKE_POSITION_INDEPENDENT_CODE YES )
36+ endif ()
37+
3738if (APPLE )
3839 find_library (CRYPTO_KIT CryptoKit)
3940 if (NOT CRYPTO_KIT)
You can’t perform that action at this time.
0 commit comments