diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2017-10-02 18:40:58 +1030 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2017-10-21 21:05:24 +1030 |
commit | 69414f14f60c49f9e0a8243603c6330fa3d11837 (patch) | |
tree | 72698180073d78afa2278af92ec55ebc21a8bbfc /CMakeLists.txt | |
parent | ecd2b7bf71b110b0e245e2866a13f2c0a901921f (diff) |
mingw build fix - use win32 threads
The cmake FindThreads detects both win32 and pthreads on mingw.
It also attempts a TryRun test for pthreads which won't work with
a cross compile.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 260e44a4..4b8a1a6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,13 @@ include(MacroOptionalFindPackage) find_package(PkgConfig) include(MacroEnsureVersion) include(MacroBoolTo01) -set(CMAKE_THREAD_PREFER_PTHREAD TRUE) -set(THREADS_PREFER_PTHREAD_FLAG TRUE) -find_package(Threads) +if (WIN32) + message("-- Using win32 threads") +else() + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Threads) +endif() include(TestBigEndian) test_big_endian(WORDS_BIGENDIAN) include(CheckFileOffsetBits) |