Skip to content

Commit

Permalink
Update Library order, because spdlog need to included a thread librar…
Browse files Browse the repository at this point in the history
…y before execution
  • Loading branch information
wesley-petit committed Jul 17, 2023
1 parent 580abec commit 466e3a6
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,21 @@ if (WIN32)
target_link_libraries(sunlight PRIVATE libxml2)
endif()

# Add multithreading support on unix
# For more information : https://stackoverflow.com/questions/1620918/cmake-and-libpthread/29871891#29871891
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(sunlight PRIVATE Threads::Threads)

# Add glm requirement
# Add spdlog
# WARNING fetching an external content will always populate the build directory
# following the standard of a lower-case name. For instance, the package LibXml2
# will have a macro libxml2_SOURCE_DIR and a directory libxml2-src directory.
# Add spdlog
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.11.0
)
FetchContent_MakeAvailable(spdlog)

target_include_directories(sunlight PRIVATE ${spdlog_SOURCE_DIR}/include)


# Add multithreading support on unix
# For more information : https://stackoverflow.com/questions/1620918/cmake-and-libpthread/29871891#29871891
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(sunlight PRIVATE Threads::Threads)
target_include_directories(sunlight PRIVATE ${spdlog_SOURCE_DIR}/include)

0 comments on commit 466e3a6

Please sign in to comment.