Use CMAKE_EXE_LINKER_FLAGS
The newere target_link_options is not supported by our minimum cmake version (3.5)
This commit is contained in:
parent
3652d5fe0d
commit
c901826317
@ -99,8 +99,13 @@ elseif (CMAKE_BUILD_TYPE_UPPER STREQUAL "COVERAGE")
|
||||
list(APPEND cxx_flags ${cxx_coverage})
|
||||
endif()
|
||||
|
||||
list(APPEND cxx_linker_flags ${cxx_flags})
|
||||
|
||||
string(REPLACE " " ";" polybar_flags_list "${POLYBAR_FLAGS}")
|
||||
list(APPEND cxx_flags ${polybar_flags_list})
|
||||
|
||||
string(REPLACE ";" " " cxx_flags_str "${cxx_flags}")
|
||||
string(REPLACE ";" " " cxx_linker_flags_str "${cxx_linker_flags}")
|
||||
|
||||
# TODO use target_link_options once min cmake version is >= 3.13
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${cxx_linker_flags_str}")
|
||||
|
@ -206,7 +206,6 @@ if(BUILD_LIBPOLY)
|
||||
endif()
|
||||
|
||||
target_compile_options(poly PUBLIC ${cxx_flags})
|
||||
target_link_options(poly PUBLIC ${cxx_linker_flags})
|
||||
set_target_properties(poly PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/libs)
|
||||
# }}}
|
||||
|
||||
@ -215,8 +214,7 @@ if(BUILD_LIBPOLY)
|
||||
add_executable(polybar main.cpp)
|
||||
target_link_libraries(polybar poly)
|
||||
target_compile_options(polybar PUBLIC ${cxx_flags})
|
||||
target_link_options(polybar PUBLIC ${cxx_linker_flags})
|
||||
set_target_properties(poly PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set_target_properties(polybar PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
install(TARGETS polybar
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
@ -234,7 +232,6 @@ if(BUILD_POLYBAR_MSG)
|
||||
utils/string.cpp)
|
||||
target_include_directories(polybar-msg PRIVATE ${includes_dir})
|
||||
target_compile_options(polybar-msg PUBLIC ${cxx_flags})
|
||||
target_link_options(polybar-msg PUBLIC ${cxx_linker_flags})
|
||||
|
||||
install(TARGETS polybar-msg
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
|
Loading…
Reference in New Issue
Block a user