Skip to content

Commit f5aca53

Browse files
committed
Refactor CMakeLists.txt to simplify target_link_libraries logic and improve readability.
1 parent f45801a commit f5aca53

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

modules/core/CMakeLists.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,19 @@ set_target_properties(${exec_func_lib} PROPERTIES LINKER_LANGUAGE CXX)
2626
add_dependencies(${exec_func_lib} ppc_libenvpp)
2727
target_link_directories(${exec_func_lib} PUBLIC "${CMAKE_BINARY_DIR}/ppc_libenvpp/install/lib")
2828
target_link_directories(${exec_func_lib} PUBLIC "${CMAKE_BINARY_DIR}/ppc_libenvpp/build")
29+
2930
if(MSVC)
30-
target_link_libraries(${exec_func_lib} PUBLIC fmt libenvpp)
31+
target_link_libraries(${exec_func_lib} PUBLIC libenvpp)
3132
else()
32-
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
33-
target_link_libraries(${exec_func_lib} PUBLIC fmtd envpp)
34-
else()
35-
target_link_libraries(${exec_func_lib} PUBLIC fmt envpp)
36-
endif()
33+
target_link_libraries(${exec_func_lib} PUBLIC envpp)
3734
endif ()
3835

36+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
37+
target_link_libraries(${exec_func_lib} PUBLIC fmtd)
38+
else()
39+
target_link_libraries(${exec_func_lib} PUBLIC fmt)
40+
endif()
41+
3942
add_dependencies(${exec_func_lib} ppc_json)
4043
target_link_directories(${exec_func_lib} INTERFACE "${CMAKE_BINARY_DIR}/ppc_json/install/include")
4144

0 commit comments

Comments
 (0)