Skip to content

Commit 0afbfd4

Browse files
[Warnings] Removed -lz Flag from Compilation
The -lz flag is used to link with the ZLIB library, but the library was already being linked; so there was no reason to add the flag. This was causing an insane number of warnings in the Clang build. If this is added back for any reason, this should be checked. Also cleaned up how ZLIB was being linked. ZLIB is required for reading and processing the atom circuit; so it should always be linked with VPR.
1 parent ead1091 commit 0afbfd4

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ endif()
130130
# Build type flags
131131
#
132132

133-
set(EXTRA_FLAGS "")
134-
if(VPR_ENABLE_INTERCHANGE)
135-
set(EXTRA_FLAGS "-lz")
136-
endif()
137-
138133
if(NOT MSVC)
139134
# for GCC and Clang
140135
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3")
@@ -298,6 +293,7 @@ endif()
298293
#
299294
# Increased debugging vebosity
300295
#
296+
set(EXTRA_FLAGS "")
301297
if(VTR_ENABLE_VERBOSE)
302298
set(EXTRA_FLAGS "${EXTRA_FLAGS} -DVTR_ENABLE_DEBUG_LOGGING")
303299
message(STATUS "Enabling increased debugging verbosity")

vpr/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,22 @@ endif ()
109109
set_target_properties(libvpr PROPERTIES PREFIX "") #Avoid extra 'lib' prefix
110110

111111
#Specify link-time dependencies
112+
find_package(ZLIB)
112113
target_link_libraries(libvpr
113-
libvtrutil
114-
libarchfpga
115-
libsdcparse
116-
libblifparse
117-
libtatum
118-
libargparse
119-
libpugixml
120-
librrgraph
114+
libvtrutil
115+
libarchfpga
116+
libsdcparse
117+
libblifparse
118+
libtatum
119+
libargparse
120+
libpugixml
121+
librrgraph
122+
ZLIB::ZLIB
121123
)
122124

123125
if(VPR_USE_SERVER)
124126
target_link_libraries(libvpr
125127
sockpp-static
126-
-lz
127128
)
128129
endif()
129130

0 commit comments

Comments
 (0)