Skip to content

Commit

Permalink
chore(cmake): sort link libaries (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrzlgnm committed Jul 15, 2024
1 parent d323e5a commit 8ee2f15
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if(MSVC)
PUBLIC DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS)
endif()
target_compile_features(monkey_lib PUBLIC cxx_std_20)
target_link_libraries(monkey_lib PRIVATE fmt::fmt doctest::doctest doctest::dll)
target_link_libraries(monkey_lib PRIVATE doctest::dll doctest::doctest fmt::fmt)

add_executable(monkey_exe source/main.cpp)
add_executable(monkey::exe ALIAS monkey_exe)
Expand Down
2 changes: 1 addition & 1 deletion test/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(Benchmark LANGUAGES CXX)
add_executable(benchmark source/main.cpp)

target_precompile_headers(benchmark REUSE_FROM monkey_lib)
target_link_libraries(benchmark PRIVATE monkey::lib fmt::fmt)
target_link_libraries(benchmark PRIVATE fmt::fmt monkey::lib)
target_compile_features(benchmark PRIVATE cxx_std_20)

add_folders(Benchmark)
3 changes: 1 addition & 2 deletions test/doctest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ target_link_libraries(doctest_dll PRIVATE doctest::doctest)
add_executable(doctest_exe main.cpp)

target_precompile_headers(doctest_exe REUSE_FROM monkey_lib)
target_link_libraries(doctest_exe PRIVATE doctest::doctest doctest::dll
fmt::fmt monkey::lib)
target_link_libraries(doctest_exe PRIVATE doctest::dll doctest::doctest fmt::fmt monkey::lib)
add_executable(doctest::exe ALIAS doctest_exe)
set_property(TARGET doctest_exe PROPERTY OUTPUT_NAME doctest)
target_compile_features(doctest_exe PRIVATE cxx_std_20)
Expand Down

0 comments on commit 8ee2f15

Please sign in to comment.