@@ -23,6 +23,9 @@ option(VTR_ENABLE_COVERAGE "Enable code coverage tracking (gcov)" OFF)
23
23
option (VTR_ENABLE_DEBUG_LOGGING "Enable debug logging" OFF )
24
24
25
25
option (WITH_BLIFEXPLORER "Enable build with blifexplorer" OFF )
26
+ option (WITH_LIBRTLNUMBER "Enable build with librtlnumber" OFF )
27
+ option (WITH_OLD_ABC "Enable build with old abc" OFF )
28
+ option (ODIN_DEBUG "Enable building oding with extra debug flags" OFF )
26
29
27
30
set (VTR_VERSION_MAJOR 8)
28
31
set (VTR_VERSION_MINOR 0)
92
95
"-Wredundant-decls" #Warn if there are overlapping declarations
93
96
"-Wswitch-default" #Warn if a switch has no default
94
97
"-Wundef" #Warn if #if() preprocessor refers to an undefined directive
98
+ "-Wunused" #Warn about unused variables/parameters
95
99
"-Wunused-variable" #Warn about variables that are not used
100
+ "-Wunused-parameter" #Warn about function parameters which are unused
96
101
"-Wdisabled-optimization" #Warn when optimizations are skipped (usually due to large/complex code)
97
102
"-Wnoexcept" #Warn when functions should be noexcept (i.e. compiler know it doesn't throw)
98
103
"-Woverloaded-virtual" #Warn when a function declaration overrides a virtual method
@@ -101,7 +106,14 @@ else()
101
106
"-Wduplicated-cond" #Warn about identical conditions in if-else chains
102
107
"-Wduplicated-branches" #Warn when different branches of an if-else chain are equivalent
103
108
"-Wnull-dereference" #Warn about null pointer dereference execution paths
109
+ "-Wuninitialized" #Warn about unitialized values
110
+ "-Winit-self" #Warn about self-initialization
111
+ "-Wcatch-value=3" #Warn when catch statements don't catch by reference
112
+ "-Wextra-semi" #Warn about redudnant semicolons
104
113
#GCC-like optional
114
+ #"-Wsuggest-final-types" #Suggest where 'final' would help if specified on a type methods
115
+ #"-Wsuggest-final-methods" #Suggest where 'final' would help if specified on methods
116
+ #"-Wsuggest-override" #Suggest where 'override' should be specified
105
117
#"-Wold-style-cast" #Warn about using c-style casts
106
118
#"-Wconversion" #Warn when type conversions may change value
107
119
#"-Wsign-conversion" #Warn if a conversion may change the sign
@@ -113,6 +125,7 @@ else()
113
125
#"-Wsign-promo" #Warn when overload resolution converts an unsigned type to signed when an unsigned overload exists
114
126
#"-Wdouble-promotion" #Warn when float is implicitly propted to double
115
127
#"-Wuseless-cast" #Warn about casts to the same type
128
+ #"-Wzero-as-null-pointer-constant" #Warn about using '0' instead of nullptr
116
129
)
117
130
endif ()
118
131
@@ -155,6 +168,7 @@ if(VTR_ENABLE_SANITIZE)
155
168
# -fuse-ld=gold force the gold linker to be used (required for sanitizers, but not enabled by default on some systems)
156
169
set (SANITIZE_FLAGS "-g -fsanitize=address -fsanitize=leak -fsanitize=undefined -fuse-ld=gold" )
157
170
message (STATUS "SANTIIZE_FLAGS: ${SANITIZE_FLAGS} " )
171
+ link_libraries ("-static-libasan" ) #Fixes 'ASan runtime does not come first in initial library list'
158
172
endif ()
159
173
160
174
#
@@ -191,10 +205,23 @@ if(VTR_ENABLE_DEBUG_LOGGING)
191
205
message (STATUS "Logging Flags: ${LOGGING_FLAGS} " )
192
206
endif ()
193
207
208
+ if (CMAKE_MAKE_PROGRAM EQUAL "ninja" )
209
+ #Only for coloured output for ninja, it may be desired
210
+ #to not force colours with other make programs (e.g. if
211
+ #being parsed by an IDE).
212
+ if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" )
213
+ set (COLORED_COMPILE "-fdiagnostics-color=always" )
214
+ elseif ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" )
215
+ set (COLORED_COMPILE "-fcolor-diagnostics" )
216
+ else ()
217
+ set (COLORED_COMPILE "" )
218
+ endif ()
219
+ endif ()
220
+
194
221
#
195
222
# Set final flags
196
223
#
197
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARN_FLAGS} ${SANITIZE_FLAGS} ${PROFILING_FLAGS} ${COVERAGE_FLAGS} ${LOGGING_FLAGS} " )
224
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARN_FLAGS} ${SANITIZE_FLAGS} ${PROFILING_FLAGS} ${COVERAGE_FLAGS} ${LOGGING_FLAGS} ${COLORED_COMPILE} " )
198
225
message (STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS} " )
199
226
200
227
@@ -231,9 +258,13 @@ add_subdirectory(vpr)
231
258
add_subdirectory (abc)
232
259
add_subdirectory (ODIN_II)
233
260
add_subdirectory (ace2)
261
+ add_subdirectory (utils)
234
262
if (WITH_BLIFEXPLORER)
235
263
add_subdirectory (blifexplorer)
236
264
endif ()
265
+ if (WITH_OLD_ABC)
266
+ add_subdirectory (abc_with_bb_support)
267
+ endif ()
237
268
238
269
#Add extra compilation flags to suppress warnings from some libraries/tools
239
270
# Note that target_compile_options() *appends* to the current compilation options of
@@ -245,10 +276,20 @@ if(CXX_COMPILER_SUPPORTS_-w)
245
276
target_compile_options (libabc PRIVATE "-w" )
246
277
target_compile_options (abc PRIVATE "-w" )
247
278
endif ()
279
+ if (CXX_COMPILER_SUPPORTS_-w)
280
+ if (WITH_OLD_ABC)
281
+ target_compile_options (liboldabc PRIVATE "-w" )
282
+ target_compile_options (oldabc PRIVATE "-w" )
283
+ endif ()
284
+ endif ()
248
285
249
286
#Some ABC headers generate warnings, treat them as system headers to suppress warnings
250
287
get_property (ABC_INCLUDE_DIRS TARGET libabc PROPERTY INCLUDE_DIRECTORIES )
251
288
target_include_directories (libabc SYSTEM INTERFACE ${ABC_INCLUDE_DIRS} )
289
+ if (WITH_OLD_ABC)
290
+ get_property (OLD_ABC_INCLUDE_DIRS TARGET liboldabc PROPERTY INCLUDE_DIRECTORIES )
291
+ target_include_directories (liboldabc SYSTEM INTERFACE ${OLD_ABC_INCLUDE_DIRS} )
292
+ endif ()
252
293
253
294
#PugiXml has some deliberate switch fallthrough cases (as indicated by comments), but they
254
295
#are tagged as warnings with g++-7 (the comments don't match g++-7's suppression regexes).
@@ -306,11 +347,25 @@ set_target_properties(libtatum
306
347
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /libs/EXTERNAL/libtatum"
307
348
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /libs/EXTERNAL/libtatum"
308
349
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /libs/EXTERNAL/libtatum" )
350
+ if (WITH_LIBRTLNUMBER)
351
+ set_target_properties (librtlnumber rtl_number
352
+ PROPERTIES
353
+ ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /libs/librtlnumber"
354
+ LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /libs/librtlnumber"
355
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /libs/librtlnumber" )
356
+ endif ()
309
357
set_target_properties (libabc abc
310
358
PROPERTIES
311
359
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /abc"
312
360
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /abc"
313
361
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /abc" )
362
+ if (WITH_OLD_ABC)
363
+ set_target_properties (liboldabc oldabc
364
+ PROPERTIES
365
+ ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /abc_with_bb_support"
366
+ LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /abc_with_bb_support"
367
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /abc_with_bb_support" )
368
+ endif ()
314
369
set_target_properties (libvpr vpr
315
370
PROPERTIES
316
371
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /vpr"
0 commit comments