From 58f475ef8352897f22b5efe231295d7f9394892f Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 29 Mar 2023 08:04:11 -0700 Subject: [PATCH] cmake link Signed-off-by: James Cherry --- CMakeLists.txt | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 222bbedf..49218a63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -473,7 +473,10 @@ configure_file(${STA_HOME}/util/StaConfig.hh.cmake # compatibility with configure set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${STA_HOME}/app) -add_library(OpenSTA +add_library(OpenSTA) + +target_sources(OpenSTA + PRIVATE ${STA_SOURCE} ${STA_TCL_INIT} @@ -493,6 +496,23 @@ add_library(OpenSTA ${BISON_VerilogParser_OUTPUTS} ) +target_link_libraries(OpenSTA + ${TCL_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} + ) + +if (TCL_READLINE_LIBRARY) + target_link_libraries(OpenSTA ${TCL_READLINE_LIBRARY}) +endif() + +if (ZLIB_LIBRARIES) + target_link_libraries(OpenSTA ${ZLIB_LIBRARIES}) +endif() + +if (CUDD_LIB) + target_link_libraries(OpenSTA ${CUDD_LIB}) +endif() + target_include_directories(OpenSTA PUBLIC include @@ -534,22 +554,8 @@ add_executable(sta app/Main.cc) target_link_libraries(sta sta_swig OpenSTA - ${TCL_LIBRARY} - ${CMAKE_THREAD_LIBS_INIT} ) -if (TCL_READLINE_LIBRARY) - target_link_libraries(sta ${TCL_READLINE_LIBRARY}) -endif() - -if (ZLIB_LIBRARIES) - target_link_libraries(sta ${ZLIB_LIBRARIES}) -endif() - -if (CUDD_LIB) - target_link_libraries(sta ${CUDD_LIB}) -endif() - message(STATUS "STA executable: ${STA_HOME}/app/sta") ################################################################