Skip to content

Commit

Permalink
Add spdlog via FetchContent instead of using system / precompiled dep…
Browse files Browse the repository at this point in the history
…endencies

Various build options affect runtime behavior, such as line endings,
which makes it difficult to use if someone wants to use the
system-provided dependencies.
  • Loading branch information
Fulgen301 committed Aug 28, 2024
1 parent 4dfbb74 commit c0228e5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CheckCXXSymbolExists)
include(CheckIncludeFileCXX)
include(CMakeDependentOption)
include(FetchContent)

# Make sure headers of the project are found
include_directories(src)
Expand Down Expand Up @@ -419,7 +420,19 @@ if (USE_SDL_MIXER)
endif ()

# Link spdlog
find_package(spdlog REQUIRED)
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.14.1
)

set(SPDLOG_BUILD_EXAMPLE OFF)
set(SPDLOG_DISABLE_DEFAULT_LOGGER ON)
set(SPDLOG_ENABLE_PCH ${USE_PCH})
set(SPDLOG_USE_STD_FORMAT ON)

FetchContent_MakeAvailable(spdlog)

target_link_libraries(standard spdlog::spdlog)

# Link Windows Imaging Component
Expand Down

0 comments on commit c0228e5

Please sign in to comment.