<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 22, 2016, at 2:11 PM, Justin Bogner <<a href="mailto:mail@justinbogner.com" class="">mail@justinbogner.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Chris Bieneman <</span><a href="mailto:beanz@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">beanz@apple.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> writes:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">beanz updated this revision to Diff 61451.<br class="">beanz added a comment.<br class=""><br class="">I kinda went a bit off into the woods after the llvm-dev thread, and I<br class="">think I came back with something either interesting or insane... you<br class="">decide.<br class=""><br class="">This patch changed a few things about how I'm handling the runtimes<br class="">subdirectory. First, it handles the compiler-rt builtin library<br class="">dependency by building the builtins first as their own external<br class="">project call. Second, it glumps all the other runtime libraries<br class="">(including compiler-rt's sanitizers) into a single external project by<br class="">using the runtimes/CMakeLists.txt file as the top-level CMake.<br class=""><br class="">This is interesting for a few reasons. The biggest is a potential for<br class="">reduced CMake-overhead when building runtime libraries. Additionally<br class="">it will allow cross-project dependencies to be more easily modeled in<br class="">CMake because the runtime libraries will be able to be aware of the<br class="">targets coming from other runtime projects.<br class=""><br class="">Thoughts?<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">This is, well, interesting. Are there any pitfalls we'll have to be</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">aware of in terms of how each runtime's cmake is set up?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>In the short term, doing it this way will allow some flexibility in getting it to work because we have a place in CMake to normalize the interfaces between runtime libraries. Longer term, I think we should move toward having all the runtime libraries conform to a consistent interface (ideally LLVMConfig.cmake).</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I think the advantages are worth the extra complexity, so this LGTM as</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">long as the answer to my question above isn't too scary, but please do</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">add some comments explaining what's going on. This is strange enough</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">that it's hard to follow as is.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Yea, comments would be good, this is a bit magic. I will update the patch shortly.</div><div><br class=""></div><div>-Chris</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><a href="http://reviews.llvm.org/D20992" class="">http://reviews.llvm.org/D20992</a><br class=""><br class="">Files:<br class=""> CMakeLists.txt<br class=""> cmake/modules/LLVMExternalProjectUtils.cmake<br class=""> runtimes/CMakeLists.txt<br class=""><br class="">Index: runtimes/CMakeLists.txt<br class="">===================================================================<br class="">--- /dev/null<br class="">+++ runtimes/CMakeLists.txt<br class="">@@ -0,0 +1,67 @@<br class="">+# Discover the projects that use CMake in the subdirectories.<br class="">+# Note that explicit cmake invocation is required every time a new project is<br class="">+# added or removed.<br class="">+<br class="">+file(GLOB entries *)<br class="">+foreach(entry ${entries})<br class="">+ if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt)<br class="">+ list(APPEND runtimes ${entry})<br class="">+ endif()<br class="">+endforeach()<br class="">+<br class="">+if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})<br class="">+<br class="">+ cmake_minimum_required(VERSION 3.4.3)<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I guess this is in here because it's redundant in the other path?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+ <br class="">+ list(INSERT CMAKE_MODULE_PATH 0<br class="">+ "${CMAKE_CURRENT_SOURCE_DIR}/../cmake"<br class="">+ "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules"<br class="">+ "${LLVM_BINARY_DIR}/lib/cmake/llvm"<br class="">+ )<br class="">+<br class="">+ include(LLVMConfig)<br class="">+<br class="">+ set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR})<br class="">+ set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_BINARY_DIR})<br class="">+<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">A comment like "configure all of the runtimes together in a single cmake</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">invocation" would probably help here.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+ foreach(entry ${runtimes})<br class="">+ get_filename_component(projName ${entry} NAME)<br class="">+<br class="">+ # TODO: Clean this up as part of an interface standardization<br class="">+ string(REPLACE "-" "_" canon_name ${projName})<br class="">+ string(TOUPPER ${canon_name} canon_name)<br class="">+ # The subdirectories need to treat this as standalone builds<br class="">+ set(${canon_name}_STANDALONE_BUILD On)<br class="">+ set(${canon_name}_BUILT_STANDALONE On)<br class="">+<br class="">+ add_subdirectory(${projName})<br class="">+ endforeach()<br class="">+<br class="">+else()<br class="">+ include(LLVMExternalProjectUtils)<br class="">+<br class="">+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt)<br class="">+ llvm_ExternalProject_Add(builtins<br class="">+ ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt/lib/builtins<br class="">+ PASSTHROUGH_PREFIXES COMPILER_RT<br class="">+ USE_TOOLCHAIN)<br class="">+ set(deps builtins)<br class="">+ endif()<br class="">+<br class="">+ foreach(entry ${runtimes})<br class="">+ get_filename_component(projName ${entry} NAME)<br class="">+ string(REPLACE "-" "_" canon_name ${projName})<br class="">+ string(TOUPPER ${canon_name} canon_name)<br class="">+ list(APPEND prefixes ${canon_name})<br class="">+ endforeach()<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Maybe explain that the prefix collection here is defining which cmake</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">variables will be available in the child invocation?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+<br class="">+ if(runtimes)<br class="">+ llvm_ExternalProject_Add(runtimes<br class="">+ ${CMAKE_CURRENT_SOURCE_DIR}<br class="">+ DEPENDS ${deps} llvm-config<br class="">+ # Builtins were built separately above<br class="">+ CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off<br class="">+ PASSTHROUGH_PREFIXES ${prefixes}<br class="">+ USE_TOOLCHAIN)<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Probably worth pointing out that this recursively configures and follows</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">the other branch of the if.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+ endif()<br class="">+endif()<br class="">Index: cmake/modules/LLVMExternalProjectUtils.cmake<br class="">===================================================================<br class="">--- cmake/modules/LLVMExternalProjectUtils.cmake<br class="">+++ cmake/modules/LLVMExternalProjectUtils.cmake<br class="">@@ -19,19 +19,25 @@<br class=""># Exclude this project from the all target<br class=""># NO_INSTALL<br class=""># Don't generate install targets for this project<br class="">+# ALWAYS_CLEAN<br class="">+# Always clean the sub-project before building<br class=""># CMAKE_ARGS arguments...<br class=""># Optional cmake arguments to pass when configuring the project<br class=""># TOOLCHAIN_TOOLS targets...<br class=""># Targets for toolchain tools (defaults to clang;lld)<br class=""># DEPENDS targets...<br class=""># Targets that this project depends on<br class=""># EXTRA_TARGETS targets...<br class=""># Extra targets in the subproject to generate targets for<br class="">+# PASSTHROUGH_PREFIXES prefix...<br class="">+# Extra variable prefixes (name is always included) to pass down<br class=""># )<br class="">function(llvm_ExternalProject_Add name source_dir)<br class="">- cmake_parse_arguments(ARG "USE_TOOLCHAIN;EXCLUDE_FROM_ALL;NO_INSTALL"<br class="">+ cmake_parse_arguments(ARG<br class="">+ "USE_TOOLCHAIN;EXCLUDE_FROM_ALL;NO_INSTALL;ALWAYS_CLEAN"<br class=""> "SOURCE_DIR"<br class="">- "CMAKE_ARGS;TOOLCHAIN_TOOLS;RUNTIME_LIBRARIES;DEPENDS;EXTRA_TARGETS" ${ARGN})<br class="">+ "CMAKE_ARGS;TOOLCHAIN_TOOLS;RUNTIME_LIBRARIES;DEPENDS;EXTRA_TARGETS;PASSTHROUGH_PREFIXES"<br class="">+ ${ARGN})<br class=""> canonicalize_tool_name(${name} nameCanon)<br class=""> if(NOT ARG_TOOLCHAIN_TOOLS)<br class=""> set(ARG_TOOLCHAIN_TOOLS clang lld)<br class="">@@ -52,6 +58,10 @@<br class=""> endif()<br class=""> endforeach()<br class=""><br class="">+ if(ARG_ALWAYS_CLEAN)<br class="">+ set(always_clean clean)<br class="">+ endif()<br class="">+<br class=""> list(FIND TOOLCHAIN_TOOLS clang FOUND_CLANG)<br class=""> if(FOUND_CLANG GREATER -1)<br class=""> set(CLANG_IN_TOOLCHAIN On)<br class="">@@ -71,15 +81,18 @@<br class=""> USES_TERMINAL<br class=""> )<br class=""><br class="">- # Find all variables that start with COMPILER_RT and populate a variable with<br class="">- # them.<br class="">+ # Find all variables that start with a prefix and propagate them through<br class=""> get_cmake_property(variableNames VARIABLES)<br class="">- foreach(variableName ${variableNames})<br class="">- if(variableName MATCHES "^${nameCanon}")<br class="">- string(REPLACE ";" "\;" value "${${variableName}}")<br class="">- list(APPEND PASSTHROUGH_VARIABLES<br class="">- -D${variableName}=${value})<br class="">- endif()<br class="">+<br class="">+ list(APPEND ARG_PASSTHROUGH_PREFIXES ${nameCanon})<br class="">+ foreach(prefix ${ARG_PASSTHROUGH_PREFIXES})<br class="">+ foreach(variableName ${variableNames})<br class="">+ if(variableName MATCHES "^${prefix}")<br class="">+ string(REPLACE ";" "\;" value "${${variableName}}")<br class="">+ list(APPEND PASSTHROUGH_VARIABLES<br class="">+ -D${variableName}=${value})<br class="">+ endif()<br class="">+ endforeach()<br class=""> endforeach()<br class=""><br class=""> if(ARG_USE_TOOLCHAIN)<br class="">@@ -117,6 +130,12 @@<br class=""> CMAKE_ARGS ${${nameCanon}_CMAKE_ARGS}<br class=""> ${compiler_args}<br class=""> -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}<br class="">+ -DLLVM_BINARY_DIR=${PROJECT_BINARY_DIR}<br class="">+ -DLLVM_CONFIG_PATH=$<TARGET_FILE:llvm-config><br class="">+ -DLLVM_ENABLE_WERROR=${LLVM_ENABLE_WERROR}<br class="">+ -DPACKAGE_VERSION=${PACKAGE_VERSION}<br class="">+ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}<br class="">+ -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}<br class=""> ${ARG_CMAKE_ARGS}<br class=""> ${PASSTHROUGH_VARIABLES}<br class=""> INSTALL_COMMAND ""<br class="">@@ -138,6 +157,7 @@<br class=""> DEPENDEES configure<br class=""> ${force_deps}<br class=""> WORKING_DIRECTORY ${BINARY_DIR}<br class="">+ EXCLUDE_FROM_MAIN 1<br class=""> USES_TERMINAL 1<br class=""> )<br class=""> ExternalProject_Add_StepTargets(${name} clean)<br class="">Index: CMakeLists.txt<br class="">===================================================================<br class="">--- CMakeLists.txt<br class="">+++ CMakeLists.txt<br class="">@@ -732,6 +732,8 @@<br class=""> add_subdirectory(tools)<br class="">endif()<br class=""><br class="">+add_subdirectory(runtimes)<br class="">+<br class="">if( LLVM_INCLUDE_EXAMPLES )<br class=""> add_subdirectory(examples)<br class="">endif()<br class="">@@ -742,7 +744,8 @@<br class=""> llvm_ExternalProject_Add(test-suite ${LLVM_MAIN_SRC_DIR}/projects/test-suite<br class=""> USE_TOOLCHAIN<br class=""> EXCLUDE_FROM_ALL<br class="">- NO_INSTALL)<br class="">+ NO_INSTALL<br class="">+ ALWAYS_CLEAN)<br class=""> endif()<br class=""> add_subdirectory(test)<br class=""> add_subdirectory(unittests)</blockquote></div></blockquote></div><br class=""></body></html>