Lines Matching +full:llvm +full:- +full:project
1 # Utility functions for packaging an LLVM distribution. See the
4 # These functions assume a number of conventions that are common across all LLVM
6 # - The generated CMake exports file for ${project} is called ${project}Targets
7 # (except for LLVM where it's called ${project}Exports for legacy reasons).
8 # - The build target for the CMake exports is called ${project}-cmake-exports
9 # (except LLVM where it's just cmake-exports).
10 # - The ${PROJECT}${distribution}_HAS_EXPORTS global property holds whether a
11 # project has any exports for a particular ${distribution} (where ${PROJECT}
12 # is the project name in uppercase).
13 # - The ${PROJECT}_CMAKE_DIR variable is computed by ${project}Config.cmake to
15 # - The ${PROJECT}_INSTALL_PACKAGE_DIR variable contains the install destination
16 # for the project's CMake modules.
26 …message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration gen…
66 # - target: The target to look up.
67 # - in_distribution_var: The variable with this name is set in the caller's
70 # - distribution_var: The variable with this name is set in the caller's scope
74 # - UMBRELLA: The (optional) umbrella target that the target is a part of. For
75 # example, all LLVM libraries have the umbrella target llvm-libraries.
111 # project. As explained at the top of the file, the project export set for a
112 # distribution is named ${project}{distribution}Targets (except for LLVM where
113 # it's named ${project}{distribution}Exports for legacy reasons). Also set the
114 # ${PROJECT}_${DISTRIBUTION}_HAS_EXPORTS global property to mark the project as
116 # - target: The target to get the EXPORT argument for.
117 # - project: The project to produce the argument for. IMPORTANT: The casing of
118 # this argument should match the casing used by the project's Config.cmake
119 # file. The correct casing for the LLVM projects is Clang, Flang, LLD, LLVM,
121 # - export_arg_var The variable with this name is set in the caller's scope to
122 # the EXPORT argument for the target for the project.
123 # - UMBRELLA: The (optional) umbrella target that the target is a part of. For
124 # example, all LLVM libraries have the umbrella target llvm-libraries.
125 function(get_target_export_arg target project export_arg_var)
126 string(TOUPPER "${project}" project_upper)
127 if(project STREQUAL "LLVM")
136 set(${export_arg_var} EXPORT ${project}${distribution}${suffix} PARENT_SCOPE)
151 # - project: The project to produce the commands for. IMPORTANT: See the comment
153 # - includes_var: The variable with this name is set in the caller's scope to
155 function(get_config_exports_includes project includes_var)
156 string(TOUPPER "${project}" project_upper)
157 set(prefix "\${${project_upper}_CMAKE_DIR}/${project}")
158 if(project STREQUAL "LLVM")
177 # The target to install ${distribution} for a project is called
178 # ${project}-${distribution}-cmake-exports, where ${project} is the project name
180 # for LLVM, where the target is just called ${distribution}-cmake-exports. See
182 # - project: The project. IMPORTANT: See the comment for get_target_export_arg
184 function(install_distribution_exports project)
185 string(TOUPPER "${project}" project_upper)
186 string(TOLOWER "${project}" project_lower)
187 if(project STREQUAL "LLVM")
191 set(prefix "${project_lower}-")
199 install(EXPORT ${project}${suffix} DESTINATION "${destination}"
200 COMPONENT ${prefix}cmake-exports)
208 set(target ${prefix}${distribution_lower}-cmake-exports)
209 install(EXPORT ${project}${distribution}${suffix} DESTINATION "${destination}"
215 add_llvm_install_targets(install-${target} COMPONENT ${target})
223 # ${distribution} target builds the distribution, install-${distribution}
224 # installs it, and install-${distribution}-stripped installs a stripped version,
228 # This function is called towards the end of LLVM's CMakeLists.txt, so all
258 set(distribution_target ${distribution_lower}-distribution)
263 add_custom_target(install-${distribution_target})
264 add_custom_target(install-${distribution_target}-stripped)
268 install-${distribution_target}
269 install-${distribution_target}-stripped
275 …# Note that some distribution components may not have an actual target, but only an install-FOO ta…
281 if(TARGET install-${target})
282 add_dependencies(install-${distribution_target} install-${target})
283 elseif(TARGET install-llvm-driver AND ${target} IN_LIST LLVM_DRIVER_TOOL_SYMLINKS)
284 add_dependencies(install-${distribution_target} install-llvm-driver)
289 if(TARGET install-${target}-stripped)
290 add_dependencies(install-${distribution_target}-stripped install-${target}-stripped)
291 elseif(TARGET install-llvm-driver-stripped AND ${target} IN_LIST LLVM_DRIVER_TOOL_SYMLINKS)
292 add_dependencies(install-${distribution_target}-stripped install-llvm-driver-stripped)
295 … "Specified distribution component '${target}' doesn't have an install-stripped target."
297 " or you should manually create the 'install-${target}-stripped' target.")