mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-26 03:35:22 +00:00
Append compile flags instead of overwriting
This commit is contained in:
parent
f9813c313d
commit
a8d12ade1c
@ -95,12 +95,9 @@ if (BUILD_SHARED_LIBS)
|
|||||||
# unused-direct-shlib-dependency /usr/lib/libformat.so.1.1.0 /lib/libm.so.6.
|
# unused-direct-shlib-dependency /usr/lib/libformat.so.1.1.0 /lib/libm.so.6.
|
||||||
target_link_libraries(cppformat -Wl,--as-needed)
|
target_link_libraries(cppformat -Wl,--as-needed)
|
||||||
endif ()
|
endif ()
|
||||||
if (FMT_PEDANTIC AND CMAKE_COMPILER_IS_GNUCXX)
|
if (FMT_PEDANTIC AND
|
||||||
set_target_properties(cppformat PROPERTIES COMPILE_FLAGS
|
(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")))
|
||||||
"-Wall -Wextra -Wshadow -pedantic")
|
set(FMT_EXTRA_COMPILE_FLAGS "-Wall -Wextra -Wshadow -pedantic")
|
||||||
endif ()
|
|
||||||
if (FMT_PEDANTIC AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -pedantic")
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# If FMT_PEDANTIC is TRUE, then test compilation with both -std=c++11
|
# If FMT_PEDANTIC is TRUE, then test compilation with both -std=c++11
|
||||||
@ -108,12 +105,15 @@ endif ()
|
|||||||
# The library is distributed in the source form and users have full control
|
# The library is distributed in the source form and users have full control
|
||||||
# over compile options, so the options used here only matter for testing.
|
# over compile options, so the options used here only matter for testing.
|
||||||
if (CPP11_FLAG AND FMT_PEDANTIC)
|
if (CPP11_FLAG AND FMT_PEDANTIC)
|
||||||
set_target_properties(cppformat PROPERTIES COMPILE_FLAGS ${CPP11_FLAG})
|
set(FMT_EXTRA_COMPILE_FLAGS "${FMT_EXTRA_COMPILE_FLAGS} ${CPP11_FLAG}")
|
||||||
# Test compilation with default flags.
|
# Test compilation with default flags.
|
||||||
file(GLOB src RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} test/*.cc test/*.h)
|
file(GLOB src RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} test/*.cc test/*.h)
|
||||||
add_library(testformat STATIC ${FMT_SOURCE_FILES} ${src})
|
add_library(testformat STATIC ${FMT_SOURCE_FILES} ${src})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
set_target_properties(cppformat
|
||||||
|
PROPERTIES COMPILE_FLAGS "${FMT_EXTRA_COMPILE_FLAGS}")
|
||||||
|
|
||||||
add_subdirectory(doc)
|
add_subdirectory(doc)
|
||||||
|
|
||||||
include_directories(. gmock)
|
include_directories(. gmock)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user