Skip to content

Commit c5675e5

Browse files
vszakatsnbaws
authored andcommitted
cmake: use the LINK_OPTIONS property with CMake 3.13+
Replacing the superseded `LINK_FLAGS` in these versions. Follow-up to 7b14449 curl#14378 Closes curl#17039
1 parent 6db6315 commit c5675e5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,11 @@ if(BUILD_SHARED_LIBS)
265265
set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/libcurl.vers")
266266
check_c_source_compiles("int main(void) { return 0; }" HAVE_VERSIONED_SYMBOLS)
267267
if(HAVE_VERSIONED_SYMBOLS)
268-
# Superseded by LINK_OPTIONS in CMake 3.13 and later.
269-
set_target_properties(${LIB_SHARED} PROPERTIES LINK_FLAGS "${CMAKE_REQUIRED_LINK_OPTIONS}")
268+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
269+
set_target_properties(${LIB_SHARED} PROPERTIES LINK_OPTIONS "${CMAKE_REQUIRED_LINK_OPTIONS}")
270+
else()
271+
set_target_properties(${LIB_SHARED} PROPERTIES LINK_FLAGS "${CMAKE_REQUIRED_LINK_OPTIONS}")
272+
endif()
270273
else()
271274
message(WARNING "Versioned symbols requested, but not supported by the toolchain.")
272275
endif()

0 commit comments

Comments
 (0)