From 0afbfd4789ae84cb1dd9f9f0e9914a3daa7437c9 Mon Sep 17 00:00:00 2001 From: AlexandreSinger Date: Mon, 5 Aug 2024 09:58:58 -0400 Subject: [PATCH] [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. --- CMakeLists.txt | 6 +----- vpr/CMakeLists.txt | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dfc90c3e851..3109cf362fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,11 +130,6 @@ endif() # Build type flags # -set(EXTRA_FLAGS "") -if(VPR_ENABLE_INTERCHANGE) - set(EXTRA_FLAGS "-lz") -endif() - if(NOT MSVC) # for GCC and Clang set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3") @@ -298,6 +293,7 @@ endif() # # Increased debugging vebosity # +set(EXTRA_FLAGS "") if(VTR_ENABLE_VERBOSE) set(EXTRA_FLAGS "${EXTRA_FLAGS} -DVTR_ENABLE_DEBUG_LOGGING") message(STATUS "Enabling increased debugging verbosity") diff --git a/vpr/CMakeLists.txt b/vpr/CMakeLists.txt index 226822084f3..0cbaec216a6 100644 --- a/vpr/CMakeLists.txt +++ b/vpr/CMakeLists.txt @@ -109,21 +109,22 @@ endif () set_target_properties(libvpr PROPERTIES PREFIX "") #Avoid extra 'lib' prefix #Specify link-time dependencies +find_package(ZLIB) target_link_libraries(libvpr - libvtrutil - libarchfpga - libsdcparse - libblifparse - libtatum - libargparse - libpugixml - librrgraph + libvtrutil + libarchfpga + libsdcparse + libblifparse + libtatum + libargparse + libpugixml + librrgraph + ZLIB::ZLIB ) if(VPR_USE_SERVER) target_link_libraries(libvpr sockpp-static - -lz ) endif()