Skip to content

Commit 0d20364

Browse files
authored
Merge pull request #906 from redboltz/fix_905
Fixed #905.
2 parents 70912ff + d53d42a commit 0d20364

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/gha.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ jobs:
248248
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
249249
shell: powershell
250250
run: |
251+
vcpkg update
251252
vcpkg install gtest:x64-windows
252253
vcpkg install zlib:x64-windows
253254
- name: Build and test

CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ IF (GTEST_FOUND AND ZLIB_FOUND AND THREADS_FOUND AND NOT "${MSGPACK_FUZZ_REGRESS
115115
OPTION (MSGPACK_GEN_COVERAGE "Enable running gcov to get a test coverage report." OFF)
116116
ENDIF ()
117117

118-
INCLUDE (CheckCXXSourceCompiles)
119-
CHECK_CXX_SOURCE_COMPILES ("
118+
119+
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
120+
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.1)
121+
INCLUDE (CheckCXXSourceCompiles)
122+
CHECK_CXX_SOURCE_COMPILES ("
120123
#include <bits/atomicity.h>
121124
int atomic_sub(int i) { return __gnu_cxx::__exchange_and_add(&i, -1) - 1; }
122125
int atomic_add(int i) { return __gnu_cxx::__exchange_and_add(&i, 1) + 1; }
@@ -125,7 +128,11 @@ int main(int argc, char * argv[])
125128
atomic_sub(1);
126129
atomic_add(1);
127130
}
128-
" MSGPACK_ENABLE_GCC_CXX_ATOMIC)
131+
"
132+
MSGPACK_ENABLE_GCC_CXX_ATOMIC)
133+
ENDIF ()
134+
ENDIF ()
135+
129136

130137
INCLUDE (Files.cmake)
131138

0 commit comments

Comments
 (0)