File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -146,17 +146,21 @@ function (add_flangrt_library name)
146
146
if (libtargets )
147
147
if (BUILD_SHARED_LIBS )
148
148
if (build_shared )
149
- add_library ( ${name} .default ALIAS ${name_shared} )
149
+ set ( default_target " ${name_shared} " )
150
150
else ()
151
- add_library ( ${name} .default ALIAS ${name_static} )
151
+ set ( default_target " ${name_static} " )
152
152
endif ()
153
153
else ()
154
154
if (build_static )
155
- add_library ( ${name} .default ALIAS ${name_static} )
155
+ set ( default_target " ${name_static} " )
156
156
else ()
157
- add_library ( ${name} .default ALIAS ${name_shared} )
157
+ set ( default_target " ${name_shared} " )
158
158
endif ()
159
159
endif ()
160
+ add_library (${name} .default ALIAS "${default_target} " )
161
+ if (NOT TARGET ${name} )
162
+ add_library (${name} ALIAS "${default_target} " )
163
+ endif ()
160
164
endif ()
161
165
162
166
foreach (tgtname IN LISTS libtargets )
Original file line number Diff line number Diff line change 8
8
9
9
macro (enable_cuda_compilation name files )
10
10
if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA" )
11
- if (NOT FLANG_RT_ENABLE_STATIC )
11
+ if (FLANG_RT_ENABLE_SHARED )
12
12
message (FATAL_ERROR
13
- "FLANG_RT_ENABLE_STATIC is required for CUDA build of Flang-RT"
13
+ "FLANG_RT_ENABLE_SHARED is not supported for CUDA offload build of Flang-RT"
14
14
)
15
15
endif ()
16
16
17
17
enable_language (CUDA )
18
18
19
- set_target_properties (${name}
19
+ set_target_properties (${name} .static
20
20
PROPERTIES
21
21
CUDA_SEPARABLE_COMPILATION ON
22
22
)
@@ -61,7 +61,7 @@ macro(enable_cuda_compilation name files)
61
61
# When using libcudacxx headers files, we have to use them
62
62
# for all files of Flang-RT.
63
63
if (EXISTS "${FLANG_RT_LIBCUDACXX_PATH} /include" )
64
- foreach (tgt IN ITEMS "${name} " "obj.${name} PTX" )
64
+ foreach (tgt IN ITEMS "${name} .static " "obj.${name} PTX" )
65
65
target_include_directories (${tgt} AFTER PRIVATE "${FLANG_RT_LIBCUDACXX_PATH} /include" )
66
66
target_compile_definitions (${tgt} PRIVATE RT_USE_LIBCUDACXX=1 )
67
67
endforeach ()
Original file line number Diff line number Diff line change @@ -139,7 +139,6 @@ if (NOT WIN32)
139
139
140
140
# Select a default runtime, which is used for unit and regression tests.
141
141
get_target_property (default_target flang_rt.default ALIASED_TARGET )
142
- add_library (flang_rt ALIAS "${default_target} " )
143
142
add_library (flang_rt.unittest ALIAS "${default_target} " )
144
143
else ()
145
144
# Target for building all versions of the runtime
You can’t perform that action at this time.
0 commit comments