[clang] 630266a - [Fuchsia] Simplified the stage2 build setup

Haowei Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 6 10:48:55 PST 2023


Author: Haowei Wu
Date: 2023-02-06T10:46:31-08:00
New Revision: 630266aed342797d6413a69b8792567fc6263501

URL: https://github.com/llvm/llvm-project/commit/630266aed342797d6413a69b8792567fc6263501
DIFF: https://github.com/llvm/llvm-project/commit/630266aed342797d6413a69b8792567fc6263501.diff

LOG: [Fuchsia] Simplified the stage2 build setup

This patch simplified the BOOTSTRAP_ flags, allowing them to be
pass through from regular flags.

Differential Revision: https://reviews.llvm.org/D143288

Added: 
    

Modified: 
    clang/cmake/caches/Fuchsia.cmake

Removed: 
    


################################################################################
diff  --git a/clang/cmake/caches/Fuchsia.cmake b/clang/cmake/caches/Fuchsia.cmake
index 7537bf8a3ee2b..0536ede83657f 100644
--- a/clang/cmake/caches/Fuchsia.cmake
+++ b/clang/cmake/caches/Fuchsia.cmake
@@ -17,6 +17,34 @@ set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
 set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
 set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
 
+# Passthrough stage1 flags to stage1.
+set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
+  LLVM_ENABLE_ZLIB
+  ZLIB_INCLUDE_DIR
+  ZLIB_LIBRARY
+  LLVM_ENABLE_ZSTD
+  zstd_DIR
+  LLVM_ENABLE_LIBXML2
+  LibXml2_ROOT
+  LLVM_ENABLE_CURL
+  CURL_ROOT
+  OpenSSL_ROOT
+  CMAKE_FIND_PACKAGE_PREFER_CONFIG
+  CMAKE_SYSROOT
+  CMAKE_MODULE_LINKER_FLAGS
+  CMAKE_SHARED_LINKER_FLAGS
+  CMAKE_EXE_LINKER_FLAGS
+)
+
+foreach(variable ${_FUCHSIA_BOOTSTRAP_PASSTHROUGH})
+  get_property(is_value_set CACHE ${variable} PROPERTY VALUE SET)
+  if(${is_value_set})
+    get_property(value CACHE ${variable} PROPERTY VALUE)
+    get_property(type CACHE ${variable} PROPERTY TYPE)
+    set(BOOTSTRAP_${variable} "${value}" CACHE ${type} "")
+  endif()
+endforeach()
+
 if(WIN32)
   set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
 endif()
@@ -105,12 +133,6 @@ if(BOOTSTRAP_CMAKE_SYSTEM_NAME)
   endif()
 endif()
 
-if(UNIX)
-  set(BOOTSTRAP_CMAKE_SHARED_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
-  set(BOOTSTRAP_CMAKE_MODULE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
-  set(BOOTSTRAP_CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
-endif()
-
 set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
 set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
 


        


More information about the cfe-commits mailing list