mirror of
https://github.com/minetest/minetest.git
synced 2024-08-19 21:14:15 +02:00
Do not link /latomic on MSVC (#14564)
MSVC does not recognize /latomic, resulting in a warning upon configure.
This commit is contained in:
parent
c8a41409d9
commit
de1d8ec070
@ -321,12 +321,14 @@ endif()
|
|||||||
# Note that find_library does not reliably find it so we have to resort to this.
|
# Note that find_library does not reliably find it so we have to resort to this.
|
||||||
# Also, passing -latomic is not always the same as adding atomic to the library list.
|
# Also, passing -latomic is not always the same as adding atomic to the library list.
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
|
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "-latomic")
|
set(CMAKE_REQUIRED_LIBRARIES "-latomic")
|
||||||
check_c_source_compiles("int main(){}" HAVE_LINK_ATOMIC)
|
check_c_source_compiles("int main(){}" HAVE_LINK_ATOMIC)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
set(CMAKE_REQUIRED_LIBRARIES "")
|
||||||
if(HAVE_LINK_ATOMIC)
|
if(HAVE_LINK_ATOMIC)
|
||||||
set(PLATFORM_LIBS ${PLATFORM_LIBS} "-latomic")
|
set(PLATFORM_LIBS ${PLATFORM_LIBS} "-latomic")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
|
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
|
||||||
|
Loading…
Reference in New Issue
Block a user