mirror of
https://github.com/libssh2/libssh2.git
synced 2025-10-24 14:53:03 +03:00
cmake: tidy up passing compiler and linker options
- prefer `set_property()` over `target_compile_options()`, to use the modern style. Follow-up to8017592163#939 - prefer to append to compiler/linker options in examples/tests. To prevent accidentally overriding a previously set option. Follow-up to14a709a72f#1686 Follow-up to854cfa8292#1524 - replace `LINK_FLAGS` with `LINK_OPTIONS` that superceded it, for CMake 3.13+. Follow-up to854cfa8292#1524 https://cmake.org/cmake/help/v4.1/prop_tgt/LINK_OPTIONS.html Closes #1690
This commit is contained in:
@@ -52,7 +52,8 @@ foreach(_example IN LISTS noinst_PROGRAMS)
|
||||
"${PROJECT_BINARY_DIR}/src"
|
||||
"${PROJECT_SOURCE_DIR}/src")
|
||||
target_link_libraries(${_example} ${LIB_SELECTED} ${LIBSSH2_LIBS})
|
||||
set_target_properties(${_example} PROPERTIES COMPILE_OPTIONS "${LIBSSH2_PICKY_C_FLAGS}" UNITY_BUILD OFF)
|
||||
set_property(TARGET ${_example} APPEND PROPERTY COMPILE_OPTIONS "${LIBSSH2_PICKY_C_FLAGS}")
|
||||
set_target_properties(${_example} PROPERTIES UNITY_BUILD OFF)
|
||||
endforeach()
|
||||
|
||||
libssh2_add_target_to_copy_dependencies(
|
||||
|
||||
Reference in New Issue
Block a user