Merge pull request #322 from The-OpenROAD-Project-staging/sta_update_upstream_lvf_stuff

Sta update upstream lvf stuff
This commit is contained in:
Matt Liberty 2026-03-27 23:06:30 +00:00 committed by GitHub
commit 41ad5c62b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 12 deletions

View File

@ -428,17 +428,15 @@ set(CMAKE_REQUIRED_FLAGS "${_sta_fmt_check_saved_flags}")
if(HAVE_CXX_STD_FORMAT)
message(STATUS "std::format: available")
else()
# Set the fmt dir for the ubuntu/centos docker files.
if(EXISTS "/usr/local/lib/cmake/fmt/fmt-config.cmake")
set(fmt_DIR "/usr/local/lib/cmake/fmt")
elseif(EXISTS "/usr/lib/x86_64-linux-gnu/cmake/fmt/fmt-config.cmake")
set(fmt_DIR "/usr/lib/x86_64-linux-gnu/cmake/fmt")
elseif(EXISTS "/usr/lib/aarch64-linux-gnu/cmake/fmt/fmt-config.cmake")
set(fmt_DIR "/usr/lib/aarch64-linux-gnu/cmake/fmt")
endif()
find_package(fmt QUIET)
if(fmt_FOUND)
message(STATUS "std::format: using installed fmt library")
# Use spdlog's bundled fmt when available to avoid ODR violations.
find_package(spdlog QUIET)
if(spdlog_FOUND)
message(STATUS "std::format: using spdlog's bundled fmt")
set(STA_USE_SPDLOG_FMT TRUE)
get_target_property(_spdlog_inc spdlog::spdlog INTERFACE_INCLUDE_DIRECTORIES)
set(_fmt_dir "${CMAKE_CURRENT_BINARY_DIR}/_spdlog_fmt")
file(MAKE_DIRECTORY "${_fmt_dir}")
file(CREATE_LINK "${_spdlog_inc}/spdlog/fmt/bundled" "${_fmt_dir}/fmt" SYMBOLIC)
else()
message(STATUS "std::format: building fmt library")
include(FetchContent)
@ -571,7 +569,12 @@ target_link_libraries(OpenSTA
)
if(NOT HAVE_CXX_STD_FORMAT)
target_link_libraries(OpenSTA fmt::fmt)
if(STA_USE_SPDLOG_FMT)
target_include_directories(OpenSTA PUBLIC "${_fmt_dir}")
target_link_libraries(OpenSTA spdlog::spdlog)
else()
target_link_libraries(OpenSTA fmt::fmt)
endif()
endif()
if (ZLIB_LIBRARIES)