2019-09-09 18:19:43 +00:00
|
|
|
set (DEFAULT_LIBS "-nodefaultlibs")
|
|
|
|
|
|
|
|
if (NOT COMPILER_CLANG)
|
|
|
|
message (FATAL_ERROR "Darwin build is supported only for Clang")
|
|
|
|
endif ()
|
|
|
|
|
2019-09-11 10:01:38 +00:00
|
|
|
set (DEFAULT_LIBS "${DEFAULT_LIBS} ${COVERAGE_OPTION} -lc -lm -lpthread -ldl")
|
2019-09-09 18:19:43 +00:00
|
|
|
|
|
|
|
message(STATUS "Default libraries: ${DEFAULT_LIBS}")
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD_LIBRARIES ${DEFAULT_LIBS})
|
|
|
|
set(CMAKE_C_STANDARD_LIBRARIES ${DEFAULT_LIBS})
|
|
|
|
|
2019-10-30 07:01:53 +00:00
|
|
|
# Minimal supported SDK version
|
|
|
|
|
2020-01-09 23:53:07 +00:00
|
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.15")
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.15")
|
|
|
|
set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -mmacosx-version-min=10.15")
|
2019-10-30 07:01:53 +00:00
|
|
|
|
2020-01-09 23:53:07 +00:00
|
|
|
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=10.15")
|
|
|
|
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mmacosx-version-min=10.15")
|
2019-10-30 07:01:53 +00:00
|
|
|
|
2019-09-09 18:19:43 +00:00
|
|
|
# Global libraries
|
|
|
|
|
|
|
|
add_library(global-libs INTERFACE)
|
|
|
|
|
|
|
|
# Unfortunately '-pthread' doesn't work with '-nodefaultlibs'.
|
|
|
|
# Just make sure we have pthreads at all.
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
include (cmake/find/cxx.cmake)
|
|
|
|
|
|
|
|
add_library(global-group INTERFACE)
|
|
|
|
|
|
|
|
target_link_libraries(global-group INTERFACE
|
|
|
|
$<TARGET_PROPERTY:global-libs,INTERFACE_LINK_LIBRARIES>
|
|
|
|
)
|
|
|
|
|
|
|
|
link_libraries(global-group)
|
|
|
|
|
|
|
|
# FIXME: remove when all contribs will get custom cmake lists
|
|
|
|
install(
|
|
|
|
TARGETS global-group global-libs
|
|
|
|
EXPORT global
|
|
|
|
)
|