Put File, BufferedFile & ErrorCode in the fmt namespace.

This commit is contained in:
Victor Zverovich
2014-06-09 09:07:27 -07:00
parent b692ab58b2
commit eaa89e23d7
8 changed files with 80 additions and 60 deletions
+13 -12
View File
@@ -46,7 +46,18 @@ if (FMT_SHARED)
set(shared SHARED)
endif ()
add_library(format ${shared} format.cc format.h)
include(CheckSymbolExists)
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_POSIX_SRC posix.cc posix.h)
endif ()
add_library(format ${shared} format.cc format.h ${FMT_POSIX_SRC})
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(format PROPERTIES COMPILE_FLAGS
"-Wall -Wextra -pedantic")
@@ -55,7 +66,7 @@ if (CPP11_FLAG AND FMT_EXTRA_TESTS)
set_target_properties(format PROPERTIES COMPILE_FLAGS ${CPP11_FLAG})
# Test compilation with default flags.
file(GLOB src RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} test/*.cc test/*.h)
add_library(testformat format.cc ${src})
add_library(testformat format.cc ${FMT_POSIX_SRC} ${src})
endif ()
add_subdirectory(doc)
@@ -77,16 +88,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_definitions(-DGTEST_USE_OWN_TR1_TUPLE=1)
endif ()
include(CheckSymbolExists)
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)
endif ()
enable_testing()
include_directories(.)