Skip to content

Commit 5fdaa38

Browse files
committed
[libc] Rework the GPU build to be a regular target
Summary: This is a massive patch because it reworks the entire build and everything that depends on it. This is not split up because various bots would fail otherwise. I will attempt to describe the necessary changes here. This patch completely reworks how the GPU build is built and targeted. Previously, we used a standard runtimes build and handled both NVPTX and AMDGPU in a single build via multi-targeting. This added a lot of divergence in the build system and prevented us from doing various things like building for the CPU / GPU at the same time, or exporting the startup libraries or running tests without a full rebuild. The new appraoch is to handle the GPU builds as strict cross-compiling runtimes. The first step required #81557 to allow the `LIBC` target to build for the GPU without touching the other targets. This means that the GPU uses all the same handling as the other builds in `libc`. The new expected way to build the GPU libc is with `LLVM_LIBC_RUNTIME_TARGETS=amdgcn-amd-amdhsa;nvptx64-nvidia-cuda`. The second step was reworking how we generated the embedded GPU library by moving it into the library install step. Where we previously had one `libcgpu.a` we now have `libcgpu-amdgpu.a` and `libcgpu-nvptx.a`. This patch includes the necessary clang / OpenMP changes to make that not break the bots when this lands. We unfortunately still require that the NVPTX target has an `internal` target for tests. This is because the NVPTX target needs to do LTO for the provided version (The offloading toolchain can handle it) but cannot use it for the native toolchain which is used for making tests. This approach is vastly suprerior in every way, allowing us to treat the GPU as a standard cross-compiling target. We can now install the GPU utilities to do things like use the offload tests and other fun things. Depends on #81557
1 parent 95e8a7c commit 5fdaa38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+564
-637
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,10 +1087,41 @@ static void addOpenMPDeviceLibC(const ToolChain &TC, const ArgList &Args,
10871087
"llvm-libc-decls");
10881088
bool HasLibC = llvm::sys::fs::exists(LibCDecls) &&
10891089
llvm::sys::fs::is_directory(LibCDecls);
1090-
if (Args.hasFlag(options::OPT_gpulibc, options::OPT_nogpulibc, HasLibC)) {
1091-
CmdArgs.push_back("-lcgpu");
1092-
CmdArgs.push_back("-lmgpu");
1090+
if (!Args.hasFlag(options::OPT_gpulibc, options::OPT_nogpulibc, HasLibC))
1091+
return;
1092+
1093+
// We don't have access to the offloading toolchains here, so determine from
1094+
// the arguments if we have any active NVPTX or AMDGPU toolchains.
1095+
llvm::DenseSet<const char *> Libraries;
1096+
if (const Arg *Targets = Args.getLastArg(options::OPT_fopenmp_targets_EQ)) {
1097+
if (llvm::any_of(Targets->getValues(),
1098+
[](auto S) { return llvm::Triple(S).isAMDGPU(); })) {
1099+
Libraries.insert("-lcgpu-amdgpu");
1100+
Libraries.insert("-lmgpu-amdgpu");
1101+
}
1102+
if (llvm::any_of(Targets->getValues(),
1103+
[](auto S) { return llvm::Triple(S).isNVPTX(); })) {
1104+
Libraries.insert("-lcgpu-nvptx");
1105+
Libraries.insert("-lmgpu-nvptx");
1106+
}
10931107
}
1108+
1109+
for (StringRef Arch : Args.getAllArgValues(options::OPT_offload_arch_EQ)) {
1110+
if (llvm::any_of(llvm::split(Arch, ","), [](StringRef Str) {
1111+
return IsAMDGpuArch(StringToCudaArch(Str));
1112+
})) {
1113+
Libraries.insert("-lcgpu-amdgpu");
1114+
Libraries.insert("-lmgpu-amdgpu");
1115+
}
1116+
if (llvm::any_of(llvm::split(Arch, ","), [](StringRef Str) {
1117+
return IsNVIDIAGpuArch(StringToCudaArch(Str));
1118+
})) {
1119+
Libraries.insert("-lcgpu-nvptx");
1120+
Libraries.insert("-lmgpu-nvptx");
1121+
}
1122+
}
1123+
1124+
llvm::append_range(CmdArgs, Libraries);
10941125
}
10951126

10961127
void tools::addOpenMPRuntimeLibraryPath(const ToolChain &TC,

clang/test/Driver/openmp-offload-gpu.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,21 @@
394394
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp \
395395
// RUN: --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget/libomptarget-nvptx-test.bc \
396396
// RUN: --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
397-
// RUN: --offload-arch=sm_52 -gpulibc -nogpuinc %s 2>&1 \
397+
// RUN: --offload-arch=sm_52,gfx90a -gpulibc -nogpuinc %s 2>&1 \
398398
// RUN: | FileCheck --check-prefix=LIBC-GPU %s
399-
// LIBC-GPU: "-lcgpu"{{.*}}"-lmgpu"
399+
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp \
400+
// RUN: --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget/libomptarget-nvptx-test.bc \
401+
// RUN: --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
402+
// RUN: -fopenmp-targets=nvptx64-nvidia-cuda,amdgcn-amd-amdhsa -gpulibc -nogpuinc %s 2>&1 \
403+
// RUN: | FileCheck --check-prefix=LIBC-GPU %s
404+
// LIBC-GPU-DAG: "-lcgpu-amdgpu"
405+
// LIBC-GPU-DAG: "-lmgpu-amdgpu"
406+
// LIBC-GPU-DAG: "-lcgpu-nvptx"
407+
// LIBC-GPU-DAG: "-lmgpu-nvptx"
400408

401409
// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp \
402410
// RUN: --libomptarget-nvptx-bc-path=%S/Inputs/libomptarget/libomptarget-nvptx-test.bc \
403411
// RUN: --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
404412
// RUN: --offload-arch=sm_52 -nogpulibc -nogpuinc %s 2>&1 \
405413
// RUN: | FileCheck --check-prefix=NO-LIBC-GPU %s
406-
// NO-LIBC-GPU-NOT: "-lcgpu"{{.*}}"-lmgpu"
414+
// NO-LIBC-GPU-NOT: -lmgpu{{.*}}-lcgpu

libc/CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ set(LIBC_NAMESPACE "__llvm_libc_${LLVM_VERSION_MAJOR}_${LLVM_VERSION_MINOR}_${LL
4343
CACHE STRING "The namespace to use to enclose internal implementations. Must start with '__llvm_libc'."
4444
)
4545

46-
if(LLVM_LIBC_FULL_BUILD OR LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
46+
if(LLVM_LIBC_FULL_BUILD OR LLVM_LIBC_GPU_BUILD)
4747
if(NOT LIBC_HDRGEN_EXE)
4848
# We need to set up hdrgen first since other targets depend on it.
4949
add_subdirectory(utils/LibcTableGenUtil)
@@ -65,7 +65,7 @@ if(("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT LLVM_RUNTIMES_BUILD) OR
6565
# to build libc-hdrgen and return.
6666

6767
# Always make the RPC server availible to other projects for GPU mode.
68-
if(LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
68+
if(LLVM_LIBC_GPU_BUILD)
6969
add_subdirectory(utils/gpu/server)
7070
endif()
7171
return()
@@ -105,7 +105,7 @@ if(COMMAND_RETURN_CODE EQUAL 0)
105105
message(STATUS "Set COMPILER_RESOURCE_DIR to "
106106
"${COMPILER_RESOURCE_DIR} using --print-resource-dir")
107107
else()
108-
if (LIBC_TARGET_ARCHITECTURE_IS_GPU)
108+
if (LIBC_TARGET_OS_IS_GPU)
109109
message(FATAL_ERROR "COMPILER_RESOURCE_DIR must be set for GPU builds")
110110
else()
111111
set(COMPILER_RESOURCE_DIR OFF)
@@ -203,11 +203,7 @@ foreach(config_path IN LISTS LIBC_CONFIG_JSON_FILE_LIST)
203203
load_libc_config(${config_path}/config.json ${cmd_line_conf})
204204
endforeach()
205205

206-
if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
207-
set(LIBC_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include)
208-
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/gpu-none-llvm)
209-
set(LIBC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
210-
elseif(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND LIBC_ENABLE_USE_BY_CLANG)
206+
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND LIBC_ENABLE_USE_BY_CLANG)
211207
set(LIBC_INCLUDE_DIR ${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE})
212208
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
213209
set(LIBC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
@@ -222,10 +218,14 @@ else()
222218
set(LIBC_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
223219
set(LIBC_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
224220
endif()
225-
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR})
221+
if(LIBC_TARGET_OS_IS_GPU)
222+
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
223+
else()
224+
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR})
225+
endif()
226226
endif()
227227

228-
if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
228+
if(LIBC_TARGET_OS_IS_GPU)
229229
include(prepare_libc_gpu_build)
230230
set(LIBC_ENABLE_UNITTESTS OFF)
231231
endif()

libc/cmake/modules/LLVMLibCArchitectures.cmake

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@
66
# platform.
77
# ------------------------------------------------------------------------------
88

9-
if(LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
10-
# We set the generic target and OS to "gpu" here. More specific defintions
11-
# for the exact target GPU are set up in prepare_libc_gpu_build.cmake.
12-
set(LIBC_TARGET_OS "gpu")
13-
set(LIBC_TARGET_ARCHITECTURE_IS_GPU TRUE)
14-
set(LIBC_TARGET_ARCHITECTURE "gpu")
15-
if(LIBC_TARGET_TRIPLE)
16-
message(WARNING "LIBC_TARGET_TRIPLE is ignored as LIBC_GPU_BUILD is on. ")
17-
endif()
18-
return()
19-
endif()
20-
219
if(MSVC)
2210
# If the compiler is visual c++ or equivalent, we will assume a host build.
2311
set(LIBC_TARGET_OS ${CMAKE_HOST_SYSTEM_NAME})
@@ -59,6 +47,10 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
5947
set(target_arch "riscv32")
6048
elseif(target_arch MATCHES "^riscv64")
6149
set(target_arch "riscv64")
50+
elseif(target_arch MATCHES "^amdgcn")
51+
set(target_arch "amdgpu")
52+
elseif(target_arch MATCHES "^nvptx64")
53+
set(target_arch "nvptx")
6254
else()
6355
return()
6456
endif()
@@ -75,6 +67,12 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
7567
set(target_sys "darwin")
7668
endif()
7769

70+
# Setting OS name for GPU architectures.
71+
list(GET triple_comps -1 target_sys)
72+
if(target_sys MATCHES "^amdhsa" OR target_sys MATCHES "^cuda")
73+
set(target_sys "gpu")
74+
endif()
75+
7876
set(${sys_var} ${target_sys} PARENT_SCOPE)
7977
endfunction(get_arch_and_system_from_triple)
8078

@@ -156,6 +154,10 @@ elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "riscv64")
156154
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "riscv32")
157155
set(LIBC_TARGET_ARCHITECTURE_IS_RISCV32 TRUE)
158156
set(LIBC_TARGET_ARCHITECTURE "riscv")
157+
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "amdgpu")
158+
set(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU TRUE)
159+
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "nvptx")
160+
set(LIBC_TARGET_ARCHITECTURE_IS_NVPTX TRUE)
159161
else()
160162
message(FATAL_ERROR
161163
"Unsupported libc target architecture ${LIBC_TARGET_ARCHITECTURE}")
@@ -178,6 +180,8 @@ elseif(LIBC_TARGET_OS STREQUAL "darwin")
178180
set(LIBC_TARGET_OS_IS_DARWIN TRUE)
179181
elseif(LIBC_TARGET_OS STREQUAL "windows")
180182
set(LIBC_TARGET_OS_IS_WINDOWS TRUE)
183+
elseif(LIBC_TARGET_OS STREQUAL "gpu")
184+
set(LIBC_TARGET_OS_IS_GPU TRUE)
181185
else()
182186
message(FATAL_ERROR
183187
"Unsupported libc target operating system ${LIBC_TARGET_OS}")

libc/cmake/modules/LLVMLibCCheckMPFR.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ set(LLVM_LIBC_MPFR_INSTALL_PATH "" CACHE PATH "Path to where MPFR is installed (
22

33
if(LLVM_LIBC_MPFR_INSTALL_PATH)
44
set(LIBC_TESTS_CAN_USE_MPFR TRUE)
5-
elseif(LIBC_TARGET_ARCHITECTURE_IS_GPU)
5+
elseif(LIBC_TARGET_OS_IS_GPU)
66
set(LIBC_TESTS_CAN_USE_MPFR FALSE)
77
else()
88
try_compile(

libc/cmake/modules/LLVMLibCHeaderRules.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function(add_gen_header target_name)
139139
${hdrgen_deps}
140140
)
141141

142-
if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
142+
if(LIBC_TARGET_OS_IS_GPU)
143143
file(MAKE_DIRECTORY ${LIBC_INCLUDE_DIR}/llvm-libc-decls)
144144
set(decl_out_file ${LIBC_INCLUDE_DIR}/llvm-libc-decls/${relative_path})
145145
add_custom_command(

libc/cmake/modules/LLVMLibCLibraryRules.cmake

Lines changed: 117 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,9 @@ function(collect_object_file_deps target result)
5050
endif()
5151
endfunction(collect_object_file_deps)
5252

53-
# A rule to build a library from a collection of entrypoint objects.
54-
# Usage:
55-
# add_entrypoint_library(
56-
# DEPENDS <list of add_entrypoint_object targets>
57-
# )
58-
#
59-
# NOTE: If one wants an entrypoint to be available in a library, then they will
60-
# have to list the entrypoint target explicitly in the DEPENDS list. Implicit
61-
# entrypoint dependencies will not be added to the library.
62-
function(add_entrypoint_library target_name)
63-
cmake_parse_arguments(
64-
"ENTRYPOINT_LIBRARY"
65-
"" # No optional arguments
66-
"" # No single value arguments
67-
"DEPENDS" # Multi-value arguments
68-
${ARGN}
69-
)
70-
if(NOT ENTRYPOINT_LIBRARY_DEPENDS)
71-
message(FATAL_ERROR "'add_entrypoint_library' target requires a DEPENDS list "
72-
"of 'add_entrypoint_object' targets.")
73-
endif()
74-
75-
get_fq_deps_list(fq_deps_list ${ENTRYPOINT_LIBRARY_DEPENDS})
53+
function(get_all_object_file_deps result fq_deps_list)
7654
set(all_deps "")
77-
foreach(dep IN LISTS fq_deps_list)
55+
foreach(dep ${fq_deps_list})
7856
get_target_property(dep_type ${dep} "TARGET_TYPE")
7957
if(NOT ((${dep_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE}) OR
8058
(${dep_type} STREQUAL ${ENTRYPOINT_EXT_TARGET_TYPE}) OR
@@ -102,6 +80,121 @@ function(add_entrypoint_library target_name)
10280
list(APPEND all_deps ${entrypoint_target})
10381
endforeach(dep)
10482
list(REMOVE_DUPLICATES all_deps)
83+
set(${result} ${all_deps} PARENT_SCOPE)
84+
endfunction()
85+
86+
# A rule to build a library from a collection of entrypoint objects and bundle
87+
# it into a GPU fatbinary. Usage is the same as 'add_entrypoint_library'.
88+
# Usage:
89+
# add_gpu_entrypoint_library(
90+
# DEPENDS <list of add_entrypoint_object targets>
91+
# )
92+
function(add_gpu_entrypoint_library target_name)
93+
cmake_parse_arguments(
94+
"ENTRYPOINT_LIBRARY"
95+
"" # No optional arguments
96+
"" # No single value arguments
97+
"DEPENDS" # Multi-value arguments
98+
${ARGN}
99+
)
100+
if(NOT ENTRYPOINT_LIBRARY_DEPENDS)
101+
message(FATAL_ERROR "'add_entrypoint_library' target requires a DEPENDS list "
102+
"of 'add_entrypoint_object' targets.")
103+
endif()
104+
105+
get_fq_deps_list(fq_deps_list ${ENTRYPOINT_LIBRARY_DEPENDS})
106+
get_all_object_file_deps(all_deps "${fq_deps_list}")
107+
108+
# The GPU 'libc' needs to be exported in a format that can be linked with
109+
# offloading langauges like OpenMP or CUDA. This wraps every GPU object into a
110+
# fat binary and adds them to a static library.
111+
set(objects "")
112+
foreach(dep IN LISTS all_deps)
113+
set(object $<$<STREQUAL:$<TARGET_NAME_IF_EXISTS:${dep}>,${dep}>:$<TARGET_OBJECTS:${dep}>>)
114+
string(FIND ${dep} "." last_dot_loc REVERSE)
115+
math(EXPR name_loc "${last_dot_loc} + 1")
116+
string(SUBSTRING ${dep} ${name_loc} -1 name)
117+
if(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
118+
set(prefix --image=arch=generic,triple=nvptx64-nvidia-cuda,feature=+ptx63)
119+
else()
120+
set(prefix --image=arch=generic,triple=amdgcn-amd-amdhsa)
121+
endif()
122+
123+
# Use the 'clang-offload-packager' to merge these files into a binary blob.
124+
add_custom_command(
125+
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/binary/${name}.gpubin"
126+
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/binary
127+
COMMAND ${LIBC_CLANG_OFFLOAD_PACKAGER}
128+
"${prefix},file=$<JOIN:${object},,file=>" -o
129+
${CMAKE_CURRENT_BINARY_DIR}/binary/${name}.gpubin
130+
DEPENDS ${dep}
131+
COMMENT "Packaging LLVM offloading binary for '${object}'"
132+
)
133+
add_custom_target(${dep}.__gpubin__ DEPENDS ${dep}
134+
"${CMAKE_CURRENT_BINARY_DIR}/binary/${name}.gpubin")
135+
136+
# CMake does not permit setting the name on object files. In order to have
137+
# human readable names we create an empty stub file with the entrypoint
138+
# name. This empty file will then have the created binary blob embedded.
139+
add_custom_command(
140+
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/stubs/${name}.cpp"
141+
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/stubs
142+
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/stubs/${name}.cpp
143+
DEPENDS ${dep} ${dep}.__gpubin__
144+
)
145+
add_custom_target(${dep}.__stub__
146+
DEPENDS ${dep}.__gpubin__ "${CMAKE_CURRENT_BINARY_DIR}/stubs/${name}.cpp")
147+
148+
add_library(${dep}.__fatbin__
149+
EXCLUDE_FROM_ALL OBJECT
150+
"${CMAKE_CURRENT_BINARY_DIR}/stubs/${name}.cpp"
151+
)
152+
153+
# This is always compiled for the LLVM host triple instead of the native GPU
154+
# triple that is used by default in the build.
155+
target_compile_options(${dep}.__fatbin__ BEFORE PRIVATE -nostdlib)
156+
target_compile_options(${dep}.__fatbin__ PRIVATE
157+
--target=${LLVM_HOST_TRIPLE}
158+
"SHELL:-Xclang -fembed-offload-object=${CMAKE_CURRENT_BINARY_DIR}/binary/${name}.gpubin")
159+
add_dependencies(${dep}.__fatbin__ ${dep} ${dep}.__stub__ ${dep}.__gpubin__)
160+
161+
# Set the list of newly create fat binaries containing embedded device code.
162+
list(APPEND objects $<TARGET_OBJECTS:${dep}.__fatbin__>)
163+
endforeach()
164+
165+
add_library(
166+
${target_name}
167+
STATIC
168+
${objects}
169+
)
170+
set_target_properties(${target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${LIBC_LIBRARY_DIR})
171+
endfunction(add_gpu_entrypoint_library)
172+
173+
# A rule to build a library from a collection of entrypoint objects.
174+
# Usage:
175+
# add_entrypoint_library(
176+
# DEPENDS <list of add_entrypoint_object targets>
177+
# )
178+
#
179+
# NOTE: If one wants an entrypoint to be available in a library, then they will
180+
# have to list the entrypoint target explicitly in the DEPENDS list. Implicit
181+
# entrypoint dependencies will not be added to the library.
182+
function(add_entrypoint_library target_name)
183+
cmake_parse_arguments(
184+
"ENTRYPOINT_LIBRARY"
185+
"" # No optional arguments
186+
"" # No single value arguments
187+
"DEPENDS" # Multi-value arguments
188+
${ARGN}
189+
)
190+
if(NOT ENTRYPOINT_LIBRARY_DEPENDS)
191+
message(FATAL_ERROR "'add_entrypoint_library' target requires a DEPENDS list "
192+
"of 'add_entrypoint_object' targets.")
193+
endif()
194+
195+
get_fq_deps_list(fq_deps_list ${ENTRYPOINT_LIBRARY_DEPENDS})
196+
get_all_object_file_deps(all_deps "${fq_deps_list}")
197+
105198
set(objects "")
106199
foreach(dep IN LISTS all_deps)
107200
list(APPEND objects $<$<STREQUAL:$<TARGET_NAME_IF_EXISTS:${dep}>,${dep}>:$<TARGET_OBJECTS:${dep}>>)

0 commit comments

Comments
 (0)