Files
TheRock/compiler/amd-llvm/libc/cmake/modules/LibcParseArguments.cmake
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

88 lines
2.1 KiB
CMake

set(LLVM_LIBC_OPTIONAL_ARGS
ALIAS
PUBLIC
NO_GPU_BUNDLE
NO_RUN_POSTBUILD
C_TEST
NEED_MPFR
NEED_MPC
IS_GPU_BENCHMARK
)
set(LLVM_LIBC_SINGLE_VALUE_ARGS
CXX_STANDARD
SUITE
CREATE_TARGET_FUNCTION
HDR
DEST_HDR
YAML_FILE
GEN_HDR
NAME
)
set(LLVM_LIBC_MULTI_VALUE_ARGS
HDRS
SRCS
COMPILE_OPTIONS
LINK_OPTIONS
LINK_LIBRARIES
ENV
DEPENDS
FLAGS
ARGS
LOADER_ARGS
)
foreach(arg_list LLVM_LIBC_OPTIONAL_ARGS LLVM_LIBC_SINGLE_VALUE_ARGS LLVM_LIBC_MULTI_VALUE_ARGS)
list(TRANSFORM ${arg_list}
PREPEND "OVERLAY_"
OUTPUT_VARIABLE ${arg_list}_OVERLAY
)
list(TRANSFORM ${arg_list}
PREPEND "FULL_BUILD_"
OUTPUT_VARIABLE ${arg_list}_FULL_BUILD
)
set(${arg_list}_COMPLETE ${${arg_list}} ${${arg_list}_OVERLAY} ${${arg_list}_FULL_BUILD})
endforeach()
macro(llvm_libc_parse_arguments name_prefix)
cmake_parse_arguments(
${name_prefix}
"${LLVM_LIBC_OPTIONAL_ARGS_COMPLETE}"
"${LLVM_LIBC_SINGLE_VALUE_ARGS_COMPLETE}"
"${LLVM_LIBC_MULTI_VALUE_ARGS_COMPLETE}"
${ARGN}
)
# Collect overlay and full build args
foreach(argument IN LISTS LLVM_LIBC_OPTIONAL_ARGS LLVM_LIBC_SINGLE_VALUE_ARGS LLVM_LIBC_MULTI_VALUE_ARGS)
if(LLVM_LIBC_FULL_BUILD)
if(${name_prefix}_${argument}_FULL_BUILD)
list(APPEND ${name_prefix}_${argument} ${${name_prefix}_${argument}_FULL_BUILD})
endif()
else()
if(${name_prefix}_${argument}_OVERLAY)
list(APPEND ${name_prefix}_${argument} ${${name_prefix}_${argument}_OVERLAY})
endif()
endif()
endforeach()
endmacro()
# Forward all arguments that can be used for llvm_libc_parse_arguments again.
# Assume that *_OVERLAY and *_FULL_BUILD args have been merged properly.
macro(forward_arguments name_prefix output)
set(${output} "")
foreach(argument ${LLVM_LIBC_OPTIONAL_ARGS})
if(${name_prefix}_${argument})
list(APPEND output ${argument})
endif()
endforeach()
foreach(argument ${LLVM_LIBC_SINGLE_VALUE_ARGS} ${LLVM_LIBC_MULTI_VALUE_ARGS})
if(${name_prefix}_${argument})
list(APPEND output ${argument} "${${name_prefix}_${argument}}")
endif()
endforeach()
endmacro()