CMAKE bug fixed when SHARED and EXAMPLES are on (#597)

Co-authored-by: andre <andre@pop-os.localdomain>
This commit is contained in:
Andre Castellanos 2020-10-03 22:10:23 -05:00 committed by GitHub
parent 2ffd4738b2
commit 3d9278cb82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -30,6 +30,13 @@ set(INSTALL_DROGON_CMAKE_DIR
if(BUILD_DROGON_SHARED)
set(BUILD_TRANTOR_SHARED TRUE)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)
# set(BUILD_EXAMPLES FALSE)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")