mirror of https://github.com/gabime/spdlog.git
Add support for CMAKE_USE_LIBCXX
Copy the "best practice" as expressed in google benchmark for providing a global option to provide support for compiling spdlog with clang's libc++ through a single global cmake customization point.pull/2285/head
parent
2f2d04b3e8
commit
52db81255d
@ -0,0 +1,26 @@
|
|||||||
|
# - Adds a compiler flag globally
|
||||||
|
#
|
||||||
|
# add_cxx_compiler_flag(<FLAG> [<VARIANT>])
|
||||||
|
#
|
||||||
|
# - Example
|
||||||
|
#
|
||||||
|
# include(AddCXXCompilerFlag)
|
||||||
|
# add_cxx_compiler_flag(-Wall)
|
||||||
|
# add_cxx_compiler_flag(-no-strict-aliasing RELEASE)
|
||||||
|
# Requires CMake 2.6+
|
||||||
|
|
||||||
|
if(__add_cxx_compiler_flag)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(__add_cxx_compiler_flag INCLUDED)
|
||||||
|
|
||||||
|
function(add_cxx_compiler_flag FLAG)
|
||||||
|
if(ARGC GREATER 1)
|
||||||
|
set(VARIANT ${ARGV1})
|
||||||
|
string(TOUPPER "_${VARIANT}" VARIANT)
|
||||||
|
else()
|
||||||
|
set(VARIANT "")
|
||||||
|
endif()
|
||||||
|
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
Loading…
Reference in New Issue