mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Moved libatomic linking to upper level CMakeLists.txt since it applies to multiple modules.
Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
This commit is contained in:
parent
ebf916edf8
commit
b0e45cfaba
@ -65,3 +65,19 @@ endif()
|
|||||||
if(SFML_BUILD_AUDIO)
|
if(SFML_BUILD_AUDIO)
|
||||||
add_subdirectory(Audio)
|
add_subdirectory(Audio)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# on some platforms (e.g. Raspberry Pi 3 armhf), GCC requires linking libatomic to use <atomic> features
|
||||||
|
# that aren't supported by native CPU instructions (64-bit atomic operations on 32-bit architecture)
|
||||||
|
if(SFML_COMPILER_GCC)
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
check_cxx_source_compiles("#include <atomic>
|
||||||
|
int main(){std::atomic_ullong x(1); return x.fetch_add(1);}" ATOMIC_TEST)
|
||||||
|
if(NOT ATOMIC_TEST)
|
||||||
|
if(SFML_BUILD_GRAPHICS)
|
||||||
|
target_link_libraries(sfml-graphics PRIVATE atomic)
|
||||||
|
endif()
|
||||||
|
if(SFML_BUILD_AUDIO)
|
||||||
|
target_link_libraries(sfml-audio PRIVATE atomic)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
@ -119,17 +119,6 @@ endif()
|
|||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
target_link_libraries(sfml-graphics PRIVATE Freetype::Freetype)
|
target_link_libraries(sfml-graphics PRIVATE Freetype::Freetype)
|
||||||
|
|
||||||
# on some platforms (e.g. Raspberry Pi 3 armhf), GCC requires linking libatomic to use <atomic> features
|
|
||||||
# that aren't supported by native CPU instructions (64-bit atomic operations on 32-bit architecture)
|
|
||||||
if(SFML_COMPILER_GCC)
|
|
||||||
include(CheckCXXSourceCompiles)
|
|
||||||
check_cxx_source_compiles("#include <atomic>
|
|
||||||
int main(){std::atomic_ullong x(1); return x.fetch_add(1);}" ATOMIC_TEST)
|
|
||||||
if(NOT ATOMIC_TEST)
|
|
||||||
target_link_libraries(sfml-graphics PRIVATE atomic)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# add preprocessor symbols
|
# add preprocessor symbols
|
||||||
target_compile_definitions(sfml-graphics PRIVATE "STBI_FAILURE_USERMSG")
|
target_compile_definitions(sfml-graphics PRIVATE "STBI_FAILURE_USERMSG")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user