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)
146146 if (libtargets)
147147 if (BUILD_SHARED_LIBS )
148148 if (build_shared)
149- add_library ( ${name} .default ALIAS ${name_shared} )
149+ set (default_target " ${name_shared} " )
150150 else ()
151- add_library ( ${name} .default ALIAS ${name_static} )
151+ set (default_target " ${name_static} " )
152152 endif ()
153153 else ()
154154 if (build_static)
155- add_library ( ${name} .default ALIAS ${name_static} )
155+ set (default_target " ${name_static} " )
156156 else ()
157- add_library ( ${name} .default ALIAS ${name_shared} )
157+ set (default_target " ${name_shared} " )
158158 endif ()
159159 endif ()
160+ add_library (${name} .default ALIAS "${default_target} " )
161+ if (NOT TARGET ${name} )
162+ add_library (${name} ALIAS "${default_target} " )
163+ endif ()
160164 endif ()
161165
162166 foreach (tgtname IN LISTS libtargets)
Original file line number Diff line number Diff line change 88
99macro (enable_cuda_compilation name files )
1010 if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA" )
11- if (NOT FLANG_RT_ENABLE_STATIC )
11+ if (FLANG_RT_ENABLE_SHARED )
1212 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"
1414 )
1515 endif ()
1616
1717 enable_language (CUDA)
1818
19- set_target_properties (${name}
19+ set_target_properties (${name} . static
2020 PROPERTIES
2121 CUDA_SEPARABLE_COMPILATION ON
2222 )
@@ -61,7 +61,7 @@ macro(enable_cuda_compilation name files)
6161 # When using libcudacxx headers files, we have to use them
6262 # for all files of Flang-RT.
6363 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" )
6565 target_include_directories (${tgt} AFTER PRIVATE "${FLANG_RT_LIBCUDACXX_PATH} /include" )
6666 target_compile_definitions (${tgt} PRIVATE RT_USE_LIBCUDACXX=1)
6767 endforeach ()
Original file line number Diff line number Diff line change @@ -139,7 +139,6 @@ if (NOT WIN32)
139139
140140 # Select a default runtime, which is used for unit and regression tests.
141141 get_target_property (default_target flang_rt.default ALIASED_TARGET)
142- add_library (flang_rt ALIAS "${default_target} " )
143142 add_library (flang_rt.unittest ALIAS "${default_target} " )
144143else ()
145144 # Target for building all versions of the runtime
You can’t perform that action at this time.
0 commit comments