Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
45a18a61
Commit
45a18a61
authored
Sep 08, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CmakeLists.txt: Added version-number and debug suffixes + SPDLOG_BUILD_SHARED property
parent
1857a44c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
CMakeLists.txt
CMakeLists.txt
+15
-4
cmake/utils.cmake
cmake/utils.cmake
+1
-0
No files found.
CMakeLists.txt
View file @
45a18a61
...
...
@@ -41,6 +41,11 @@ if (NOT DEFINED SPDLOG_MASTER_PROJECT)
endif
()
endif
()
# build shared option
if
(
NOT WIN32
)
option
(
SPDLOG_BUILD_SHARED
"Build shared library"
OFF
)
endif
()
# example options
option
(
SPDLOG_BUILD_EXAMPLE
"Build example"
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_BUILD_EXAMPLE_HO
"Build header only example"
OFF
)
...
...
@@ -81,11 +86,14 @@ set(SPDLOG_SRCS
src/file_sinks.cpp
src/async.cpp
)
if
(
BUILD_SHARED_LIBS AND WIN32
)
message
(
WARNING
"shared libs is not supported in spdlog - building static instead"
)
add_library
(
spdlog STATIC
${
SPDLOG_SRCS
}
${
SPDLOG_ALL_HEADERS
}
)
if
(
SPDLOG_BUILD_SHARED
)
if
(
WIN32
)
message
(
FATAL_ERROR
"spdlog shared lib is not yet supported under windows"
)
endif
()
add_library
(
spdlog SHARED
${
SPDLOG_SRCS
}
${
SPDLOG_ALL_HEADERS
}
)
else
()
add_library
(
spdlog
${
SPDLOG_SRCS
}
${
SPDLOG_ALL_HEADERS
}
)
add_library
(
spdlog
STATIC
${
SPDLOG_SRCS
}
${
SPDLOG_ALL_HEADERS
}
)
endif
()
add_library
(
spdlog::spdlog ALIAS spdlog
)
...
...
@@ -97,6 +105,9 @@ target_include_directories(spdlog PUBLIC
target_link_libraries
(
spdlog PUBLIC Threads::Threads
)
spdlog_enable_warnings
(
spdlog
)
set_target_properties
(
spdlog PROPERTIES VERSION
${
SPDLOG_VERSION
}
SOVERSION
${
SPDLOG_VERSION_MAJOR
}
)
set_target_properties
(
spdlog PROPERTIES DEBUG_POSTFIX d
)
#---------------------------------------------------------------------------------------
# Header only version
#---------------------------------------------------------------------------------------
...
...
cmake/utils.cmake
View file @
45a18a61
...
...
@@ -19,6 +19,7 @@ function(spdlog_extract_version)
endif
()
set
(
ver_patch
${
CMAKE_MATCH_1
}
)
set
(
SPDLOG_VERSION_MAJOR
${
ver_major
}
PARENT_SCOPE
)
set
(
SPDLOG_VERSION
"
${
ver_major
}
.
${
ver_minor
}
.
${
ver_patch
}
"
PARENT_SCOPE
)
endfunction
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment