Skip to content

Commit 3b4e0ab

Browse files
acomodikmurray
authored andcommitted
ODIN_II: added -Werror when BUILD_TYPE is release_strict
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent f6d4cf9 commit 3b4e0ab

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ override CMAKE_PARAMS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -G 'Unix Makefil
3333
#Are we doing a strict (i.e. warnings as errors) build?
3434
ifneq (,$(findstring strict,$(BUILD_TYPE)))
3535
#Configure for strict build with VPR warning treated as errors
36-
override CMAKE_PARAMS := -DVPR_COMPILE_OPTIONS=strict ${CMAKE_PARAMS}
36+
override CMAKE_PARAMS := -DVTR_COMPILE_OPTIONS=strict ${CMAKE_PARAMS}
3737
endif #Strict build type
3838

3939
# -s : Suppresss makefile output (e.g. entering/leaving directories)

ODIN_II/CMakeLists.txt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.9)
22

33
project("ODIN_II")
44

5+
#
6+
# ODIN_II Build Options
7+
#
8+
set(VTR_COMPILE_OPTIONS "none" CACHE STRING "Specify whether ODIN_II uses strict compiling options, e.g. -Werror")
9+
set(CACHE VTR_COMPILE_OPTIONS PROPERTY STRING strict none)
10+
511
if(ODIN_DEBUG)
612

713
message("*** Compiling with Odin debug flags")
@@ -112,7 +118,7 @@ add_library(libodin_ii STATIC
112118
${LIB_HEADERS_H}
113119
${LIB_HEADERS_HPP}
114120
${LIB_SOURCES}
115-
${FLEX_VerilogLexer_OUTPUTS}
121+
${FLEX_VerilogLexer_OUTPUTS}
116122
${BISON_VerilogParser_OUTPUT_SOURCE})
117123

118124
target_include_directories(libodin_ii PUBLIC ${LIB_INCLUDE_DIRS})
@@ -164,4 +170,19 @@ if (ODIN_USES_IPO)
164170
set_target_properties(odin_II PROPERTIES LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS})
165171
endif()
166172

173+
set(ODIN_COMPILE_OPTIONS_FLAGS
174+
#GCC-like
175+
"-Werror"
176+
)
177+
178+
#add strict odin compiler flags, if set
179+
if(VTR_COMPILE_OPTIONS STREQUAL "strict")
180+
message(STATUS "ODIN_II: building with strict flags")
181+
foreach(ODIN_FLAG ${ODIN_COMPILE_OPTIONS_FLAGS})
182+
message(STATUS "\tAdding CXX flag: ${ODIN_FLAG}")
183+
target_compile_options(libodin_ii PRIVATE ${ODIN_FLAG})
184+
target_compile_options(odin_II PRIVATE ${ODIN_FLAG})
185+
endforeach()
186+
endif()
187+
167188
install(TARGETS odin_II libodin_ii DESTINATION bin)

vpr/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ project("vpr")
55
#
66
# VPR Build Options
77
#
8-
set(VPR_COMPILE_OPTIONS "none" CACHE STRING "Specify whether vpr uses strict compiling options, e.g. -Werror")
9-
set(CACHE VPR_COMPILE_OPTIONS PROPERTY STRING strict none)
8+
set(VTR_COMPILE_OPTIONS "none" CACHE STRING "Specify whether vpr uses strict compiling options, e.g. -Werror")
9+
set(CACHE VTR_COMPILE_OPTIONS PROPERTY STRING strict none)
1010

1111
set(VPR_EXECUTION_ENGINE "auto" CACHE STRING "Specify the framework for (potential) parallel execution")
1212
set_property(CACHE VPR_EXECUTION_ENGINE PROPERTY STRINGS auto serial tbb)
@@ -68,7 +68,7 @@ target_link_libraries(libvpr
6868

6969
#link graphics library only when graphics set to on
7070
if (VPR_USE_EZGL STREQUAL "on")
71-
target_link_libraries(libvpr
71+
target_link_libraries(libvpr
7272
ezgl)
7373

7474
compile_gresources(
@@ -164,7 +164,7 @@ else()
164164
message(ERROR "Unsupported VPR_PGO_CONFIG '${VPR_PGO_CONFIG}'")
165165
endif()
166166

167-
if (VPR_COMPILE_OPTIONS STREQUAL "strict")
167+
if (VTR_COMPILE_OPTIONS STREQUAL "strict")
168168
message(STATUS "VPR: building with strict flags")
169169
foreach(flag ${VPR_COMPILE_OPTIONS_FLAGS})
170170
message(STATUS "\tAdding CXX flag: ${flag}")

0 commit comments

Comments
 (0)