mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
避免其他模块查找过程污染基础环境
Close https://github.com/ZLMediaKit/ZLMediaKit/issues/1840
This commit is contained in:
parent
d9d33b8522
commit
25e9cd07db
@ -193,6 +193,22 @@ endif()
|
|||||||
update_cached_list(MK_LINK_LIBRARIES "")
|
update_cached_list(MK_LINK_LIBRARIES "")
|
||||||
update_cached_list(MK_COMPILE_DEFINITIONS ENABLE_VERSION)
|
update_cached_list(MK_COMPILE_DEFINITIONS ENABLE_VERSION)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/checks/atomic_check.cpp atomic_check_cpp)
|
||||||
|
check_cxx_source_compiles("${atomic_check_cpp}" HAVE_CXX_ATOMICS_WITHOUT_LIB)
|
||||||
|
if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
|
||||||
|
# cmake --help-policy CMP0075
|
||||||
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
|
||||||
|
check_cxx_source_compiles("${atomic_check_cpp}" HAVE_CXX_ATOMICS_WITH_LIB)
|
||||||
|
if(NOT HAVE_CXX_ATOMICS_WITH_LIB)
|
||||||
|
message(WARNING "Compiler doesn't support std::atomic<long long>")
|
||||||
|
else()
|
||||||
|
update_cached_list(MK_LINK_LIBRARIES atomic)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# 多个模块依赖 ffmpeg 相关库, 统一查找
|
# 多个模块依赖 ffmpeg 相关库, 统一查找
|
||||||
if(ENABLE_FFMPEG)
|
if(ENABLE_FFMPEG)
|
||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
@ -368,22 +384,6 @@ elseif(NOT ANDROID OR IOS)
|
|||||||
update_cached_list(MK_LINK_LIBRARIES pthread)
|
update_cached_list(MK_LINK_LIBRARIES pthread)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
||||||
include(CheckCXXSourceCompiles)
|
|
||||||
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/checks/atomic_check.cpp atomic_check_cpp)
|
|
||||||
check_cxx_source_compiles("${atomic_check_cpp}" HAVE_CXX_ATOMICS_WITHOUT_LIB)
|
|
||||||
if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
|
|
||||||
# cmake --help-policy CMP0075
|
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
|
|
||||||
check_cxx_source_compiles("${atomic_check_cpp}" HAVE_CXX_ATOMICS_WITH_LIB)
|
|
||||||
if(NOT HAVE_CXX_ATOMICS_WITH_LIB)
|
|
||||||
message(WARNING "Compiler doesn't support std::atomic<long long>")
|
|
||||||
else()
|
|
||||||
update_cached_list(MK_LINK_LIBRARIES atomic)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Solution folders:
|
# Solution folders:
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user