File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 3.0)
1+ cmake_minimum_required (VERSION 3.0.2 )
22project (Jinja2Cpp VERSION 0.5.0)
33
44list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} /cmake)
@@ -55,9 +55,24 @@ target_link_libraries(${LIB_TARGET_NAME} PUBLIC ThirdParty::nonstd boost_variant
5555target_include_directories (${LIB_TARGET_NAME}
5656 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} /include )
5757
58+
5859if (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)
6277endif ()
6378
You can’t perform that action at this time.
0 commit comments