fix(src/CMakeLists.txt): add -lpthread only if MULTI_THREAD is ON

This commit is contained in:
Soonho Kong 2015-04-30 09:55:38 -04:00
parent 7bae895c23
commit c7f1e3737f

View file

@ -88,7 +88,7 @@ endif()
if(STATIC)
message(STATUS "Creating a static executable")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (MULTI_THREAD AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LEAN_EXTRA_LINKER_FLAGS "${LEAN_EXTRA_LINKER_FLAGS} -Wl,--whole-archive -lpthread -Wl,--no-whole-archive")
endif()
set(LEAN_EXTRA_LINKER_FLAGS "${LEAN_EXTRA_LINKER_FLAGS} -static")