cmake find_package Threads

This commit is contained in:
James Cherry 2020-09-09 09:43:37 -07:00
parent ab2b1924e8
commit 6edbc13083
1 changed files with 3 additions and 5 deletions

View File

@ -376,6 +376,8 @@ find_package(TCL)
# Zlib # Zlib
include(FindZLIB) include(FindZLIB)
find_package(Threads)
################################################################ ################################################################
# #
# Locate CUDD bdd package. # Locate CUDD bdd package.
@ -481,6 +483,7 @@ target_link_libraries(sta
sta_swig sta_swig
OpenSTA OpenSTA
${TCL_LIBRARY} ${TCL_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
) )
if (ZLIB_LIBRARIES) if (ZLIB_LIBRARIES)
@ -493,11 +496,6 @@ endif()
message(STATUS "STA executable: ${STA_HOME}/app/sta") message(STATUS "STA executable: ${STA_HOME}/app/sta")
# g++ std::thread apparently still needs -pthreads.
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_link_libraries(sta -pthread)
endif()
target_compile_options(sta PUBLIC ${STA_COMPILE_OPTIONS}) target_compile_options(sta PUBLIC ${STA_COMPILE_OPTIONS})
################################################################ ################################################################