File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,23 @@ if(FLEX_BISON_WARN_SUPPRESS_FLAGS)
4040 PROPERTIES COMPILE_FLAGS ${FLEX_BISON_WARN_SUPPRESS_FLAGS} )
4141endif ()
4242
43+ # Grammars generated by Bison 3.0.4 and below emit a null pointer dereference warning
44+ # when compiled with GCC 7
45+ include (CheckCXXCompilerFlag)
46+ check_cxx_compiler_flag(-Werror=null-dereference NULL_DEREFERENCE)
47+ if (${NULL_DEREFERENCE} AND ${BISON_VERSION} VERSION_LESS 3.0.5)
48+ get_source_file_property (BISON_COMPILE_FLAGS ${BISON_SdcParser_OUTPUT_SOURCE} COMPILE_FLAGS )
49+ set_source_files_properties (${BISON_SdcParser_OUTPUT_SOURCE}
50+ PROPERTIES COMPILE_FLAGS ${BISON_COMILE_FLAGS} -Wno-error=null-dereference)
51+ endif ()
52+
53+ check_cxx_compiler_flag(-Wswitch-default SWITCH_DEFAULT)
54+ if (${SWITCH_DEFAULT} )
55+ get_source_file_property (BISON_COMPILE_FLAGS ${BISON_SdcParser_OUTPUT_SOURCE} COMPILE_FLAGS )
56+ set_source_files_properties (${BISON_SdcParser_OUTPUT_SOURCE}
57+ PROPERTIES COMPILE_FLAGS ${BISON_COMILE_FLAGS} -Wno-switch-default)
58+ endif ()
59+
4360#Create the library
4461add_library (libsdcparse STATIC
4562 ${LIB_HEADERS}
You can’t perform that action at this time.
0 commit comments