mirror of
https://github.com/curl/curl.git
synced 2026-08-02 01:00:28 +03:00
cmake: use more COMPILER_OPTIONS, LINK_OPTIONS / LINK_FLAGS
- replace `COMPILE_FLAGS` with `COMPILE_OPTIONS` that superceded it. Follow-up to6140dfcf3ehttps://cmake.org/cmake/help/v4.1/prop_sf/COMPILE_FLAGS.html - replace `target_link_libraries()` with `LINK_FLAGS` property for CMake <=3.12, because we are passing linker options (not libs). Follow-up to91720b620e#18468 Follow-up to548873921c#17670 Follow-up to95aea798db#5843 https://cmake.org/cmake/help/v3.7/command/target_link_libraries.html https://cmake.org/cmake/help/v3.7/prop_tgt/LINK_FLAGS.html - replace `target_link_options()` with `LINK_OPTIONS` propery for CMake 3.13+, to use the modern style. Follow-up to91720b620e#18468 Follow-up to548873921c#17670 https://cmake.org/cmake/help/v3.13/command/target_link_options.html https://cmake.org/cmake/help/v3.13/prop_tgt/LINK_OPTIONS.html Also: - fix to append to, not override, previously set linker options when using `CURL_LIBCURL_VERSIONED_SYMBOLS=ON`. Before this patch, it was overwriting linker options when using `CURL_CODE_COVERAGE=ON`. Follow-up to91720b620e#18468 Closes #18762
This commit is contained in:
parent
81a9197102
commit
e17aa98bfe
2 changed files with 11 additions and 11 deletions
|
|
@ -123,9 +123,9 @@ endif()
|
|||
|
||||
if(ENABLE_UNICODE AND MINGW AND NOT MINGW32CE)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
|
||||
target_link_options(${EXE_NAME} PRIVATE "-municode")
|
||||
set_property(TARGET ${EXE_NAME} APPEND PROPERTY LINK_OPTIONS "-municode")
|
||||
else()
|
||||
target_link_libraries(${EXE_NAME} PRIVATE "-municode")
|
||||
set_property(TARGET ${EXE_NAME} APPEND PROPERTY LINK_FLAGS "-municode")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
@ -133,9 +133,9 @@ if(CURL_CODE_COVERAGE)
|
|||
set_property(TARGET ${EXE_NAME} APPEND PROPERTY COMPILE_DEFINITIONS ${CURL_COVERAGE_MACROS})
|
||||
set_property(TARGET ${EXE_NAME} APPEND PROPERTY COMPILE_OPTIONS ${CURL_COVERAGE_CFLAGS})
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
|
||||
target_link_options(${EXE_NAME} PRIVATE ${CURL_COVERAGE_LDFLAGS})
|
||||
set_property(TARGET ${EXE_NAME} APPEND PROPERTY LINK_OPTIONS ${CURL_COVERAGE_LDFLAGS})
|
||||
else()
|
||||
target_link_libraries(${EXE_NAME} PRIVATE ${CURL_COVERAGE_LDFLAGS})
|
||||
set_property(TARGET ${EXE_NAME} APPEND PROPERTY LINK_FLAGS ${CURL_COVERAGE_LDFLAGS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue