CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
56 lines
2.2 KiB
CMake
56 lines
2.2 KiB
CMake
#===============================================================================
|
|
# Define targets for linking against the selected C library
|
|
#
|
|
# After including this file, the following targets are defined:
|
|
# - runtimes-libc-headers: An interface target that allows getting access to the
|
|
# headers of the selected C library.
|
|
# - runtimes-libc-shared: A target representing the selected shared C library.
|
|
# - runtimes-libc-static: A target representing the selected static C library.
|
|
#===============================================================================
|
|
|
|
include_guard(GLOBAL)
|
|
|
|
if(TARGET runtimes-libc-headers)
|
|
return()
|
|
endif()
|
|
|
|
set(RUNTIMES_SUPPORTED_C_LIBRARIES system llvm-libc picolibc newlib)
|
|
set(RUNTIMES_USE_LIBC "system" CACHE STRING "Specify C library to use. Supported values are ${RUNTIMES_SUPPORTED_C_LIBRARIES}.")
|
|
if (NOT "${RUNTIMES_USE_LIBC}" IN_LIST RUNTIMES_SUPPORTED_C_LIBRARIES)
|
|
message(FATAL_ERROR "Unsupported C library: '${RUNTIMES_USE_LIBC}'. Supported values are ${RUNTIMES_SUPPORTED_C_LIBRARIES}.")
|
|
endif()
|
|
|
|
# Link against a system-provided libc
|
|
if (RUNTIMES_USE_LIBC STREQUAL "system")
|
|
add_library(runtimes-libc-headers INTERFACE)
|
|
|
|
add_library(runtimes-libc-static INTERFACE)
|
|
add_library(runtimes-libc-shared INTERFACE)
|
|
|
|
# Link against the in-tree LLVM libc
|
|
elseif (RUNTIMES_USE_LIBC STREQUAL "llvm-libc")
|
|
add_library(runtimes-libc-headers INTERFACE)
|
|
target_link_libraries(runtimes-libc-headers INTERFACE libc-headers)
|
|
check_cxx_compiler_flag(-nostdlibinc CXX_SUPPORTS_NOSTDLIBINC_FLAG)
|
|
if(CXX_SUPPORTS_NOSTDLIBINC_FLAG)
|
|
target_compile_options(runtimes-libc-headers INTERFACE "-nostdlibinc")
|
|
if(LIBC_KERNEL_HEADERS)
|
|
target_compile_options(runtimes-libc-headers INTERFACE "-idirafter${LIBC_KERNEL_HEADERS}")
|
|
endif()
|
|
endif()
|
|
|
|
add_library(runtimes-libc-static INTERFACE)
|
|
if (TARGET libc)
|
|
target_link_libraries(runtimes-libc-static INTERFACE libc)
|
|
endif()
|
|
if (TARGET libm)
|
|
target_link_libraries(runtimes-libc-static INTERFACE libm)
|
|
endif()
|
|
if (CXX_SUPPORTS_NOLIBC_FLAG)
|
|
target_link_options(runtimes-libc-static INTERFACE "-nolibc")
|
|
endif()
|
|
|
|
# TODO: There's no support for building LLVM libc as a shared library yet.
|
|
add_library(runtimes-libc-shared INTERFACE)
|
|
endif()
|