mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 17:19:34 +08:00
Allow user to choose between static or shared library
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
project(SpdlogExamples CXX)
|
||||
|
||||
if(NOT TARGET spdlog)
|
||||
if(NOT TARGET spdlog::spdlog)
|
||||
# Stand-alone build
|
||||
find_package(spdlog CONFIG REQUIRED)
|
||||
endif()
|
||||
@@ -34,14 +34,14 @@ find_package(Threads REQUIRED)
|
||||
add_executable(example example.cpp)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
find_library(log-lib log)
|
||||
target_link_libraries(example spdlog::static Threads::Threads log)
|
||||
target_link_libraries(example spdlog::spdlog Threads::Threads log)
|
||||
else()
|
||||
target_link_libraries(example spdlog::static Threads::Threads)
|
||||
target_link_libraries(example spdlog::spdlog Threads::Threads)
|
||||
endif()
|
||||
|
||||
|
||||
add_executable(multisink multisink.cpp)
|
||||
target_link_libraries(multisink spdlog::static Threads::Threads)
|
||||
target_link_libraries(multisink spdlog::spdlog Threads::Threads)
|
||||
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
||||
|
||||
|
Reference in New Issue
Block a user