Skip to content

Commit 919fda0

Browse files
committed
Post-merge fixes
1 parent 5bc9686 commit 919fda0

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

flang-rt/cmake/modules/AddFlangRT.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ function (add_flangrt_library name)
142142
add_library("${name_shared}" SHARED ${extra_args} ${ARG_ADDITIONAL_HEADERS} ${ARG_UNPARSED_ARGUMENTS})
143143
endif ()
144144

145-
# Provide a default target if building both and which exists in either setting.
146145
if (libtargets)
146+
# Provide a default alias which exists in either setting.
147147
if (BUILD_SHARED_LIBS)
148148
if (build_shared)
149149
set(default_target "${name_shared}")
@@ -158,8 +158,14 @@ function (add_flangrt_library name)
158158
endif ()
159159
endif ()
160160
add_library(${name}.default ALIAS "${default_target}")
161+
162+
# Provide a build target that builds any enabled library.
163+
# Not intended for target_link_libraries. Either use the ${name}.static,
164+
# ${name}.shared variants, or ${name}.default to let BUILD_SHARED_LIBS
165+
# decide.
161166
if (NOT TARGET ${name})
162-
add_library(${name} ALIAS "${default_target}")
167+
add_custom_target(${name})
168+
add_dependencies(${name} ${libtargets})
163169
endif ()
164170
endif ()
165171

flang-rt/examples/ExternalHelloWorld/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ add_llvm_example(external-hello-world
1313

1414
target_link_libraries(external-hello-world
1515
PRIVATE
16-
flang_rt.runtime
16+
flang_rt.runtime.default
1717
)

flang-rt/lib/cuda/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ add_flangrt_library(flang_rt.cuda STATIC SHARED
2727

2828
# For the static library, link-in the static dependencies as well.
2929
if (TARGET flang_rt.cuda.static)
30-
target_link_libraries(flang.cuda.static PUBLIC
30+
target_link_libraries(flang_rt.cuda.static PUBLIC
3131
flang_rt.runtime.static
3232
CUDA::cudart_static
3333
)
3434
endif ()
3535

3636
# For the shared library, use the shared versions of the dependencies.
3737
if (TARGET flang_rt.cuda.shared)
38-
target_link_libraries(CufRuntime.shared PUBLIC
39-
flang_rt.shared
38+
target_link_libraries(flang_rt.cuda.shared PUBLIC
39+
flang_rt.runtime.shared
4040
CUDA::cudart
4141
)
4242
endif ()

flang-rt/unittests/Runtime/CUDA/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ add_flangrt_unittest(FlangCufRuntimeTests
1414

1515
target_link_libraries(FlangCufRuntimeTests
1616
PRIVATE
17-
flang_rt.cuda
17+
flang_rt.cuda.default
1818
)

0 commit comments

Comments
 (0)