Skip to content

Commit 88ac8d4

Browse files
committed
Exposed setting of the VERBOSE compilation flag via Makefile and CMake, added checking building with VERBOSE in CI
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
1 parent e689ada commit 88ac8d4

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ jobs:
6767
Build:
6868
name: 'B: Building VtR'
6969
runs-on: ubuntu-18.04
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
include:
74+
- { build_type: 'release', verbose: '0' }
75+
- { build_type: 'debug', verbose: '0' }
76+
- { build_type: 'debug', verbose: '1' }
7077
steps:
7178

7279
- uses: actions/setup-python@v2
@@ -79,10 +86,10 @@ jobs:
7986

8087
- name: Test
8188
env:
82-
BUILD_TYPE: release
89+
BUILD_TYPE: ${{ matrix.build_type }}
8390
run: |
8491
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
85-
./.github/scripts/build.sh
92+
./.github/scripts/build.sh VERBOSE=${{ matrix.verbose }}
8693
8794
8895
Format:

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ option(VTR_ENABLE_SANITIZE "Enable address/leak/undefined-behaviour sanitizers (
3131
option(VTR_ENABLE_PROFILING "Enable performance profiler (gprof)" OFF)
3232
option(VTR_ENABLE_COVERAGE "Enable code coverage tracking (gcov)" OFF)
3333
option(VTR_ENABLE_DEBUG_LOGGING "Enable debug logging" OFF)
34+
option(VTR_ENABLE_VERBOSE "Enable increased debug verbosity" OFF)
3435

3536
#Allow the user to decide whether to compile the graphics library
3637
set(VPR_USE_EZGL "auto" CACHE STRING "Specify whether vpr uses the graphics library")
@@ -285,6 +286,14 @@ if(VTR_ENABLE_DEBUG_LOGGING)
285286
message(STATUS "Logging Flags: ${LOGGING_FLAGS}")
286287
endif()
287288

289+
#
290+
# Increased debugging vebosity
291+
#
292+
if(VTR_ENABLE_VERBOSE)
293+
set(EXTRA_FLAGS "${EXTRA_FLAGS} -DVTR_ENABLE_DEBUG_LOGGING")
294+
message(STATUS "Enabling increased debugging verbosity")
295+
endif()
296+
288297
if (CMAKE_MAKE_PROGRAM EQUAL "ninja" )
289298
#Only for coloured output for ninja, it may be desired
290299
#to not force colours with other make programs (e.g. if

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#
1111
# To perform a debug build use:
1212
# 'make BUILD_TYPE=debug'
13+
#
14+
# To enable debugging verbose messages as well use:
15+
#
16+
# 'make BUILD_TYPE=debug VERBOSE=1'
1317

1418
#Default build type
1519
# Possible values:
@@ -19,6 +23,9 @@
1923
# strict #Build VPR with warnings treated as errors
2024
BUILD_TYPE ?= release
2125

26+
#Debugging verbosity enable
27+
VERBOSE ?= 0
28+
2229
#Convert to lower case for consistency
2330
BUILD_TYPE := $(shell echo $(BUILD_TYPE) | tr '[:upper:]' '[:lower:]')
2431

@@ -36,6 +43,11 @@ ifneq (,$(findstring strict,$(BUILD_TYPE)))
3643
override CMAKE_PARAMS := -DVTR_ENABLE_STRICT_COMPILE=on ${CMAKE_PARAMS}
3744
endif #Strict build type
3845

46+
#Enable verbosity
47+
ifeq ($(VERBOSE),1)
48+
override CMAKE_PARAMS := -DVTR_ENABLE_VERBOSE=on ${CMAKE_PARAMS}
49+
endif
50+
3951
# -s : Suppresss makefile output (e.g. entering/leaving directories)
4052
# --output-sync target : For parallel compilation ensure output for each target is synchronized (make version >= 4.0)
4153
MAKEFLAGS := -s

0 commit comments

Comments
 (0)