CMake: Use imported target for fmt in tests

This properly adds the header include paths when using system fmt
This commit is contained in:
TellowKrinkle 2023-01-29 14:37:54 -06:00
parent d380d43209
commit 07e98c7790
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND})
string(APPEND CMAKE_RUNTIME_OUTPUT_DIRECTORY "/Tests") string(APPEND CMAKE_RUNTIME_OUTPUT_DIRECTORY "/Tests")
add_library(unittests_main OBJECT UnitTestsMain.cpp) add_library(unittests_main OBJECT UnitTestsMain.cpp)
target_link_libraries(unittests_main PUBLIC fmt gtest) target_link_libraries(unittests_main PUBLIC fmt::fmt gtest)
# Since this is a Core dependency, it can't be linked as a normal library. # Since this is a Core dependency, it can't be linked as a normal library.
# Otherwise CMake inserts the library after core, but before other core # Otherwise CMake inserts the library after core, but before other core
# dependencies like videocommon which also use Host_ functions, which makes the # dependencies like videocommon which also use Host_ functions, which makes the