Skip to content

Commit c045ed4

Browse files
authored
Merge pull request #55 from Manu343726/master
Disable boost::recursive_wrapper maybe-uninitialized flags on GCC 6
2 parents 50e17af + 03cefe2 commit c045ed4

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

CMakeLists.txt

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.0)
1+
cmake_minimum_required(VERSION 3.0.2)
22
project(Jinja2Cpp VERSION 0.5.0)
33

44
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@@ -55,9 +55,24 @@ target_link_libraries(${LIB_TARGET_NAME} PUBLIC ThirdParty::nonstd boost_variant
5555
target_include_directories(${LIB_TARGET_NAME}
5656
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
5757

58+
5859
if(NOT MSVC)
59-
target_compile_options(boost_assert INTERFACE -Wno-error-parentheses -Wno-parentheses)
60-
target_compile_options(boost_filesystem PRIVATE -Wno-error-deprecated-declarations -Wno-deprecated-declarations)
60+
# Enable -Werror and -Wall on jinja2cpp target, ignoring warning errors from thirdparty libs
61+
include(CheckCXXCompilerFlag)
62+
check_cxx_compiler_flag(-Wno-error=parentheses COMPILER_HAS_WNO_ERROR_PARENTHESES_FLAG)
63+
check_cxx_compiler_flag(-Wno-error=deprecated-declarations COMPILER_HAS_WNO_ERROR_DEPRECATED_DECLARATIONS_FLAG)
64+
check_cxx_compiler_flag(-Wno-error=maybe-uninitialized COMPILER_HAS_WNO_ERROR_MAYBE_UNINITIALIZED_FLAG)
65+
66+
if(COMPILER_HAS_WNO_ERROR_PARENTHESES_FLAG)
67+
target_compile_options(boost_assert INTERFACE -Wno-error=parentheses)
68+
endif()
69+
if(COMPILER_HAS_WNO_ERROR_DEPRECATED_DECLARATIONS_FLAG)
70+
target_compile_options(boost_filesystem PRIVATE -Wno-error=deprecated-declarations)
71+
endif()
72+
if(COMPILER_HAS_WNO_ERROR_MAYBE_UNINITIALIZED_FLAG)
73+
target_compile_options(boost_variant INTERFACE -Wno-error=maybe-uninitialized)
74+
endif()
75+
6176
target_compile_options(${LIB_TARGET_NAME} PRIVATE -Wall -Werror)
6277
endif()
6378

0 commit comments

Comments
 (0)