2020-04-07 08:33:49 +00:00
|
|
|
set (DEFAULT_LIBS "-nodefaultlibs")
|
|
|
|
|
|
|
|
if (NOT COMPILER_CLANG)
|
|
|
|
message (FATAL_ERROR "FreeBSD build is supported only for Clang")
|
|
|
|
endif ()
|
|
|
|
|
2020-04-18 13:54:45 +00:00
|
|
|
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64")
|
|
|
|
execute_process (COMMAND ${CMAKE_CXX_COMPILER} --print-file-name=libclang_rt.builtins-x86_64.a OUTPUT_VARIABLE BUILTINS_LIBRARY OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
else ()
|
|
|
|
execute_process (COMMAND ${CMAKE_CXX_COMPILER} --print-file-name=libclang_rt.builtins-${CMAKE_SYSTEM_PROCESSOR}.a OUTPUT_VARIABLE BUILTINS_LIBRARY OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
endif ()
|
2020-04-07 08:33:49 +00:00
|
|
|
|
|
|
|
set (DEFAULT_LIBS "${DEFAULT_LIBS} ${BUILTINS_LIBRARY} ${COVERAGE_OPTION} -lc -lm -lrt -lpthread")
|
|
|
|
|
|
|
|
message(STATUS "Default libraries: ${DEFAULT_LIBS}")
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD_LIBRARIES ${DEFAULT_LIBS})
|
|
|
|
set(CMAKE_C_STANDARD_LIBRARIES ${DEFAULT_LIBS})
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
2022-01-31 07:27:00 +00:00
|
|
|
include (cmake/unwind.cmake)
|
2022-01-31 07:26:07 +00:00
|
|
|
include (cmake/cxx.cmake)
|
2022-11-15 16:53:24 +00:00
|
|
|
link_libraries(global-group)
|
2020-04-07 08:33:49 +00:00
|
|
|
|
|
|
|
target_link_libraries(global-group INTERFACE
|
|
|
|
$<TARGET_PROPERTY:global-libs,INTERFACE_LINK_LIBRARIES>
|
|
|
|
)
|
|
|
|
|
|
|
|
# FIXME: remove when all contribs will get custom cmake lists
|
|
|
|
install(
|
|
|
|
TARGETS global-group global-libs
|
|
|
|
EXPORT global
|
|
|
|
)
|