Link libwinpthread statically if LINK_STD_STATICALLY is on.
This commit is contained in:
parent
8d95b099b4
commit
45122c12c5
|
@ -164,8 +164,14 @@ endif()
|
|||
|
||||
if (LINK_STD_STATICALLY)
|
||||
message(STATUS "Linking std libraries statically")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
|
||||
target_link_libraries(${ANGELSCRIPT_LIBRARY_NAME} -lpthread -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ )
|
||||
set(as_LINKS -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++)
|
||||
if (MSVC)
|
||||
set(as_LINKS "${as_LINKS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
|
||||
else()
|
||||
set(as_LINKS "${as_LINKS} -Wl,-Bdynamic -lpthread")
|
||||
endif(MSVC)
|
||||
message(STATUS "Angelscript LINKS ${as_LINKS}")
|
||||
target_link_libraries(${ANGELSCRIPT_LIBRARY_NAME} ${as_LINKS})
|
||||
else()
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
|
Loading…
Reference in New Issue