File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,23 @@ cmake_minimum_required(VERSION 3.10)
22
33project (dbc)
44
5+ option (DEBUG "use debug flag" NO )
6+
57# specify the C++ standard
68set (CMAKE_CXX_STANDARD 11)
79set (CMAKE_CXX_STANDARD_REQUIRED True )
810
9- # Add in the debug flag0.
10- set (GCC_COVERAGE_COMPILE_FLAGS "-g" )
11+ set (GCC_COMPILE_FLAGS "-Wextra -Wall -Wfloat-equal -Wundef -Wshadow \
12+ -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wwrite-strings \
13+ -Waggregate-return -Wcast-qual -Wswitch-default -Wswitch-enum -Wconversion \
14+ -Wunreachable-code -Wformat=2 -Werror -Wuninitialized -Winit-self" )
15+
16+ if (DEBUG)
17+ set (GCC_COMPILE_FLAGS ${GCC_COMPILE_FLAGS} " -g" )
18+ else ()
19+ set (GCC_COMPILE_FLAGS ${GCC_COMPILE_FLAGS} " -O2" )
20+ endif ()
21+
1122set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} " )
1223
1324# add where to find the source files
Original file line number Diff line number Diff line change 22#include " util/utils.hpp"
33
44#include < regex>
5- #include < iostream>
65
76namespace libdbc {
87
@@ -51,8 +50,6 @@ namespace libdbc {
5150 const std::regex name_space_re;
5251
5352 void parse_dbc_header (std::istream& file_stream) {
54- std::vector<std::string> lines;
55-
5653 std::string line;
5754 std::smatch match;
5855 bool is_blank = true ;
You can’t perform that action at this time.
0 commit comments