more update sta fmp and existing spdlog handling
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
This commit is contained in:
parent
676942555c
commit
c5f5468ca0
3
BUILD
3
BUILD
|
|
@ -183,7 +183,8 @@ genrule(
|
|||
#define STA_VERSION "2.7.0"
|
||||
#define STA_GIT_SHA1 "f21d4a3878e2531e3af4930818d9b5968aad9416"
|
||||
#define SSTA 0
|
||||
#define ZLIB_FOUND' > \"$@\"
|
||||
#define ZLIB_FOUND
|
||||
#define HAVE_CXX_STD_FORMAT 1' > \"$@\"
|
||||
""",
|
||||
visibility = ["//:__subpackages__"],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 PUBLIC spdlog::spdlog)
|
||||
else()
|
||||
target_link_libraries(OpenSTA fmt::fmt)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ZLIB_LIBRARIES)
|
||||
|
|
|
|||
Loading…
Reference in New Issue