Skip to content

Commit

Permalink
Remove unneccesary link targets as they are propagated automatically
Browse files Browse the repository at this point in the history
The new way of cmake is automatic propagation and inheritance of compiler
flags and linker arguments based on PUBLIC, PRIVATE, an INTERFACE arguments
in the target commands.

Signed-off-by: Christoph Niethammer <[email protected]>
  • Loading branch information
cniethammer committed Dec 13, 2024
1 parent 8da7e45 commit cbe6a66
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ else (WS_PARALLEL)
SET(PARLIB "")
endif (WS_PARALLEL)

ADD_SUBDIRECTORY(${workspace_SOURCE_DIR}/external/yaml-cpp)
add_subdirectory(${workspace_SOURCE_DIR}/external/yaml-cpp)
add_subdirectory(${workspace_SOURCE_DIR}/external/rapidyaml ryml)
include_directories(${RYAML_INCLUDE_DIR})
ADD_SUBDIRECTORY(${workspace_SOURCE_DIR}/external/fmt)
add_subdirectory(${workspace_SOURCE_DIR}/external/fmt)

get_directory_property(LINKER_VAR LINK_DIRECTORIES)
message(STATUS "LINKER_VAR: ${LINKER_VAR}")
Expand Down Expand Up @@ -125,13 +124,13 @@ ADD_LIBRARY(ws_common OBJECT
${workspace_SOURCE_DIR}/src/caps.cpp
)

TARGET_LINK_LIBRARIES(ws_common PUBLIC yaml-cpp::yaml-cpp fmt::fmt ryml::ryml c4core::c4core)
TARGET_LINK_LIBRARIES(ws_common PUBLIC yaml-cpp::yaml-cpp fmt::fmt ryml::ryml)

ADD_EXECUTABLE( ws_list ${workspace_SOURCE_DIR}/src/ws_list.cpp )
TARGET_LINK_LIBRARIES( ws_list "-L${LINKER_VAR}" ws_common ${Boost_LIBRARIES} ${EXTRA_STATIC_LIBS} ${LIBCAP} yaml-cpp::yaml-cpp fmt::fmt ryml::ryml c4core::c4core ${PARLIB})
TARGET_LINK_LIBRARIES( ws_list "-L${LINKER_VAR}" ws_common ${Boost_LIBRARIES} ${EXTRA_STATIC_LIBS} ${LIBCAP} fmt::fmt ${PARLIB})

ADD_EXECUTABLE( ws_allocate ${workspace_SOURCE_DIR}/src/ws_allocate.cpp )
TARGET_LINK_LIBRARIES( ws_allocate "-L${LINKER_VAR}" ws_common ${Boost_LIBRARIES} ${EXTRA_STATIC_LIBS} ${LIBCAP} yaml-cpp::yaml-cpp fmt::fmt ryml::ryml c4core::c4core ${PARLIB})
TARGET_LINK_LIBRARIES( ws_allocate "-L${LINKER_VAR}" ws_common ${Boost_LIBRARIES} ${EXTRA_STATIC_LIBS} ${LIBCAP} fmt::fmt ${PARLIB})



Expand Down

0 comments on commit cbe6a66

Please sign in to comment.