mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Add CMake check for libatomic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217666 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8f3452d079
commit
6354451c6a
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
INCLUDE(CheckCXXSourceCompiles)
|
INCLUDE(CheckCXXSourceCompiles)
|
||||||
|
|
||||||
|
check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC)
|
||||||
|
if (HAVE_LIBATOMIC)
|
||||||
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
|
||||||
|
endif()
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -25,9 +25,6 @@ if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN)
|
|||||||
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||||
set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
||||||
set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
|
set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
|
||||||
if (ANDROID)
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "atomic")
|
|
||||||
endif()
|
|
||||||
check_cxx_source_compiles("
|
check_cxx_source_compiles("
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
std::atomic<float> x(0.0f);
|
std::atomic<float> x(0.0f);
|
||||||
|
@ -132,6 +132,9 @@ if( NOT MSVC )
|
|||||||
set(system_libs ${system_libs} ${TERMINFO_LIBS})
|
set(system_libs ${system_libs} ${TERMINFO_LIBS})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
if( LLVM_ENABLE_THREADS AND HAVE_LIBATOMIC )
|
||||||
|
set(system_libs ${system_libs} atomic)
|
||||||
|
endif()
|
||||||
if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
|
if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
|
||||||
set(system_libs ${system_libs} pthread)
|
set(system_libs ${system_libs} pthread)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user