Files
TCPlayerbotCore/dep/cppformat/CMakeLists.txt
T
Naios 95ebe4f31c Core/Log: Add type safe formatting
* improves safety and log speed through:
  - variadic templates
  - perfect forwarding
* fixes a newline in db logs
* improve performance of Appender::write by using std::ostringstream && std::move
2015-03-13 09:15:42 +01:00

36 lines
850 B
CMake

include(CheckCXXCompilerFlag)
include(CheckSymbolExists)
set(FMT_SOURCES format.cc format.h)
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(format PROPERTIES COMPILE_FLAGS
"-Wall -Wextra -Wshadow -pedantic")
endif ()
# Use variadic templates
add_definitions(-DFMT_VARIADIC_TEMPLATES=1)
# Check if initializer lists are supported.
check_cxx_source_compiles("
#include <initilizer_list>
int main() {}" FMT_INITIALIZER_LIST)
# Use delete
add_definitions(-DFMT_USE_DELETED_FUNCTIONS=1)
# Use static assert
add_definitions(-DFMT_USE_STATIC_ASSERT=1)
if (WIN32)
check_symbol_exists(open io.h HAVE_OPEN)
else ()
check_symbol_exists(open fcntl.h HAVE_OPEN)
endif ()
if (HAVE_OPEN)
add_definitions(-DFMT_USE_FILE_DESCRIPTORS=1)
set(FMT_SOURCES ${FMT_SOURCES} posix.cc posix.h)
endif ()
add_library(format STATIC ${FMT_SOURCES})