[llvm] r358779 - [CMake] Pass monorepo build settings in cross compile
Don Hinton via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 21 11:25:54 PDT 2019
Hi Chris:
You need to escape the semicolons:
diff --git a/llvm/cmake/modules/CrossCompile.cmake
b/llvm/cmake/modules/CrossCompile.cmake
index 6d186de2724..157f4dd4ff3 100644
--- a/llvm/cmake/modules/CrossCompile.cmake
+++ b/llvm/cmake/modules/CrossCompile.cmake
@@ -45,6 +45,11 @@ function(llvm_create_cross_target_internal target_name
toolchain buildtype)
string(REPLACE ";" "$<SEMICOLON>" experimental_targets_to_build_arg
"${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}")
+ string(REPLACE ";" "$<SEMICOLON>" llvm_enable_projects_arg
+ "${LLVM_ENABLE_PROJECTS}")
+ string(REPLACE ";" "$<SEMICOLON>" llvm_external_projects_arg
+ "${LLVM_EXTERNAL_PROJECTS}")
+
add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}/CMakeCache.txt
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-DCMAKE_MAKE_PROGRAM="${CMAKE_MAKE_PROGRAM}"
@@ -54,8 +59,8 @@ function(llvm_create_cross_target_internal target_name
toolchain buildtype)
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${experimental_targets_to_build_arg}"
-DLLVM_DEFAULT_TARGET_TRIPLE="${TARGET_TRIPLE}"
-DLLVM_TARGET_ARCH="${LLVM_TARGET_ARCH}"
- -DLLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS}"
- -DLLVM_EXTERNAL_PROJECTS="${LLVM_EXTERNAL_PROJECTS}"
+ -DLLVM_ENABLE_PROJECTS="${llvm_enable_projects_arg}"
+ -DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}"
-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}"
${build_type_flags} ${linker_flag} ${external_clang_dir}
WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
On Fri, Apr 19, 2019 at 1:06 PM Chris Bieneman via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: cbieneman
> Date: Fri Apr 19 13:08:55 2019
> New Revision: 358779
>
> URL: http://llvm.org/viewvc/llvm-project?rev=358779&view=rev
> Log:
> [CMake] Pass monorepo build settings in cross compile
>
> This allows the cross compiled build targets to configure the LLVM tools
> and sub-projects that are part of the main build.
>
> This is needed for generating native non llvm *-tablegen tools when cross
> compiling clang in the monorepo build environment.
>
> Modified:
> llvm/trunk/cmake/modules/CrossCompile.cmake
>
> Modified: llvm/trunk/cmake/modules/CrossCompile.cmake
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/CrossCompile.cmake?rev=358779&r1=358778&r2=358779&view=diff
>
> ==============================================================================
> --- llvm/trunk/cmake/modules/CrossCompile.cmake (original)
> +++ llvm/trunk/cmake/modules/CrossCompile.cmake Fri Apr 19 13:08:55 2019
> @@ -54,6 +54,8 @@ function(llvm_create_cross_target_intern
>
> -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${experimental_targets_to_build_arg}"
> -DLLVM_DEFAULT_TARGET_TRIPLE="${TARGET_TRIPLE}"
> -DLLVM_TARGET_ARCH="${LLVM_TARGET_ARCH}"
> + -DLLVM_ENABLE_PROJECTS="${LLVM_ENABLE_PROJECTS}"
> + -DLLVM_EXTERNAL_PROJECTS="${LLVM_EXTERNAL_PROJECTS}"
>
> -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}"
> ${build_type_flags} ${linker_flag} ${external_clang_dir}
> WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190421/e5a76138/attachment.html>
More information about the llvm-commits
mailing list