Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pthreads in AppVeyor build #479

Merged
merged 2 commits into from Feb 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions appveyor.yml
@@ -1,6 +1,12 @@
install:
- curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.11-msvc.zip -o libsodium-1.0.11-msvc.zip
- unzip libsodium-1.0.11-msvc.zip
- mkdir libsodium && cd libsodium
- curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.11-msvc.zip -o libsodium.zip
- unzip libsodium.zip
- cd ..
- mkdir pthreads-win32 && cd pthreads-win32
- curl ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip -o pthreads.zip
- unzip pthreads.zip
- cd ..

before_build:
- cmake . -DBOOTSTRAP_DAEMON=OFF -DENABLE_SHARED=OFF
Expand Down
20 changes: 17 additions & 3 deletions cmake/Dependencies.cmake
Expand Up @@ -40,17 +40,31 @@ pkg_use_module(SNDFILE sndfile )
###############################################################################

if(NOT LIBSODIUM_FOUND)
include_directories(include)
include_directories(libsodium/include)
find_library(LIBSODIUM_LIBRARIES
NAMES
sodium
libsodium
PATHS
Win32/Release/v140/static
x64/Release/v140/static
libsodium/Win32/Release/v140/static
libsodium/x64/Release/v140/static
)
if(LIBSODIUM_LIBRARIES)
set(LIBSODIUM_FOUND TRUE)
endif()
add_definitions(-DSODIUM_STATIC)
message("libsodium: ${LIBSODIUM_LIBRARIES}")
endif()

if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") AND CMAKE_USE_WIN32_THREADS_INIT)
include_directories(pthreads-win32/Pre-built.2/include)
find_library(CMAKE_THREAD_LIBS_INIT
NAMES
pthreadVC2
PATHS
pthreads-win32/Pre-built.2/lib/x86
pthreads-win32/Pre-built.2/lib/x64
)
add_definitions(-DHAVE_STRUCT_TIMESPEC)
message("libpthreads: ${CMAKE_THREAD_LIBS_INIT}")
endif()