From 9515077e1e8070747abd06338ec77e17e33f0a8f Mon Sep 17 00:00:00 2001 From: Pcornat Date: Tue, 29 Oct 2024 22:50:13 +0100 Subject: [PATCH] Adding spdlog in CMakeLists.txt --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f258d06..0979898 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,14 @@ else () endif () add_subdirectory(external/assimp EXCLUDE_FROM_ALL) +option(SPDLOG_ENABLE_PCH "Build static or shared library using precompiled header to speed up compilation time" ON) +option(SPDLOG_BUILD_WARNINGS "Enable compiler warnings" ON) +option(SPDLOG_PREVENT_CHILD_FD "Prevent from child processes to inherit log file descriptors" ON) +option(SPDLOG_NO_THREAD_ID "prevent spdlog from querying the thread id on each log call if thread id is not needed" ON) +option(SPDLOG_NO_TLS "prevent spdlog from using thread local storage" ON) +option(SPDLOG_NO_ATOMIC_LEVELS "prevent spdlog from using of std::atomic log levels (use only if your code never modifies log levels concurrently" ON) +add_subdirectory(external/spdlog EXCLUDE_FROM_ALL) + add_executable(LearnGtk4 main.cpp hello_world.cpp hello_world.hpp @@ -67,7 +75,7 @@ add_executable(LearnGtk4 main.cpp app_win_2_back.hpp ) -set_target_properties(LearnGtk4 assimp PROPERTIES +set_target_properties(LearnGtk4 assimp spdlog_header_only PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF @@ -78,4 +86,4 @@ target_compile_definitions(LearnGtk4 PUBLIC $<$:_GLIBCXX_DEBUG>) target_compile_definitions(assimp PUBLIC $<$:_GLIBCXX_DEBUG>) target_compile_options(LearnGtk4 PUBLIC ${COMPILE_FLAGS}) target_link_options(LearnGtk4 PUBLIC ${LINKER_OPTIONS}) -target_link_libraries(LearnGtk4 PkgConfig::GTKMM4 assimp) +target_link_libraries(LearnGtk4 PkgConfig::GTKMM4 assimp spdlog_header_only)