Skip to content

Commit 2d37e29

Browse files
committed
[cmake] Add libatomic_ops only for msvc
Other compilers should support builtin atomics so don't require libatomic_ops with gc 8.2
1 parent 7a400f3 commit 2d37e29

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

CMakeLists.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -263,25 +263,28 @@ add_executable(nekovm
263263

264264
# We need to build from source on Windows regardless
265265
if (STATIC_BOEHMGC OR WIN32)
266-
ExternalProject_Add(libatomic_ops
267-
${EP_CONFIGS}
268-
URL https://github.com/ivmai/libatomic_ops/releases/download/v7.8.10/libatomic_ops-7.8.10.tar.gz
269-
URL_HASH SHA256=0db3ebff755db170f65e74a64ec4511812e9ee3185c232eeffeacd274190dfb0
270-
CONFIGURE_COMMAND echo skip config
271-
BUILD_COMMAND echo skip build
272-
INSTALL_COMMAND echo skip install
273-
)
274-
set_target_properties(libatomic_ops PROPERTIES ${EP_PROPS})
275-
276266
set (
277267
BoehmGC_CONFIGS
278-
DEPENDS libatomic_ops
279268
URL https://github.com/ivmai/bdwgc/releases/download/v8.2.10/gc-8.2.10.tar.gz
280269
URL_HASH SHA256=832cf4f7cf676b59582ed3b1bbd90a8d0e0ddbc3b11cb3b2096c5177ce39cc47
281270
)
282271

283272
set(GC_INCLUDE_DIR ${CMAKE_BINARY_DIR}/libs/src/BoehmGC-build/include)
284273

274+
if (MSVC)
275+
ExternalProject_Add(libatomic_ops
276+
${EP_CONFIGS}
277+
URL https://github.com/ivmai/libatomic_ops/releases/download/v7.8.10/libatomic_ops-7.8.10.tar.gz
278+
URL_HASH SHA256=0db3ebff755db170f65e74a64ec4511812e9ee3185c232eeffeacd274190dfb0
279+
CONFIGURE_COMMAND echo skip config
280+
BUILD_COMMAND echo skip build
281+
INSTALL_COMMAND echo skip install
282+
)
283+
set_target_properties(libatomic_ops PROPERTIES ${EP_PROPS})
284+
285+
list(APPEND BoehmGC_CONFIGS DEPENDS libatomic_ops)
286+
endif()
287+
285288
if (WIN32)
286289
set(GC_LIBRARIES
287290
${CMAKE_BINARY_DIR}/libs/src/BoehmGC-build/${CMAKE_CFG_INTDIR}/gc.lib

0 commit comments

Comments
 (0)