Skip to content

Commit

Permalink
Don't link against pthread on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
MKleusberg committed Jun 7, 2018
1 parent 909e311 commit d585024
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Expand Up @@ -290,6 +290,8 @@ if(WIN32)
ELSE( MINGW )
set(SQLB_SRC ${SQLB_SRC} "${CMAKE_CURRENT_SOURCE_DIR}/src/winapp.rc")
ENDIF( MINGW )
else()
set(LPTHREAD pthread)
endif(WIN32)

#enable version check for MacOS
Expand Down Expand Up @@ -374,7 +376,7 @@ endif()
target_link_libraries(${PROJECT_NAME}
qhexedit
qcustomplot
pthread
${LPTHREAD}
${QT_LIBRARIES}
${WIN32_STATIC_LINK}
${LIBSQLITE}
Expand Down
8 changes: 6 additions & 2 deletions src/tests/CMakeLists.txt
@@ -1,5 +1,9 @@
include_directories("${CMAKE_CURRENT_BINARY_DIR}" ..)

if(NOT WIN32)
set(LPTHREAD pthread)
endif()

# test-sqlobjects

set(TESTSQLOBJECTS_SRC
Expand Down Expand Up @@ -54,7 +58,7 @@ else()
endif()
link_directories("${CMAKE_CURRENT_BINARY_DIR}/${QSCINTILLA_DIR}")
add_dependencies(test-sqlobjects qscintilla2)
target_link_libraries(test-sqlobjects qscintilla2 pthread)
target_link_libraries(test-sqlobjects qscintilla2 ${LPTHREAD})
add_test(test-sqlobjects test-sqlobjects)

# test-import
Expand Down Expand Up @@ -126,7 +130,7 @@ else()
endif()
link_directories("${CMAKE_CURRENT_BINARY_DIR}/${QSCINTILLA_DIR}")
add_dependencies(test-regex qscintilla2)
target_link_libraries(test-regex qscintilla2 pthread)
target_link_libraries(test-regex qscintilla2 ${LPTHREAD})
add_test(test-regex test-regex)

# test cache
Expand Down

0 comments on commit d585024

Please sign in to comment.