forked from Mirrorlandia_minetest/minetest
master #6
@ -316,9 +316,14 @@ endif()
|
|||||||
|
|
||||||
# On clang and gcc, some functionalities of std::atomic require -latomic.
|
# On clang and gcc, some functionalities of std::atomic require -latomic.
|
||||||
# See <https://en.cppreference.com/w/cpp/atomic/atomic#Notes>.
|
# See <https://en.cppreference.com/w/cpp/atomic/atomic#Notes>.
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
|
# Note that find_library does not reliably find it so we have to resort to this.
|
||||||
OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
# Also, passing -latomic is not always the same as adding atomic to the library list.
|
||||||
set(PLATFORM_LIBS ${PLATFORM_LIBS} atomic)
|
include(CheckCSourceCompiles)
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES "-latomic")
|
||||||
|
check_c_source_compiles("int main(){}" HAVE_LINK_ATOMIC)
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES "")
|
||||||
|
if(HAVE_LINK_ATOMIC)
|
||||||
|
set(PLATFORM_LIBS ${PLATFORM_LIBS} "-latomic")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_include_files(endian.h HAVE_ENDIAN_H)
|
check_include_files(endian.h HAVE_ENDIAN_H)
|
||||||
|
Loading…
Reference in New Issue
Block a user