From 0f5090f0df61cbb134adb96e6427797c1882b1b4 Mon Sep 17 00:00:00 2001 From: ichern Date: Mon, 9 Sep 2019 11:09:42 +0200 Subject: [PATCH] Add changes from #309 --- tools/build_defs/cmake_script.bzl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/build_defs/cmake_script.bzl b/tools/build_defs/cmake_script.bzl index bb004c158..b642cf72a 100644 --- a/tools/build_defs/cmake_script.bzl +++ b/tools/build_defs/cmake_script.bzl @@ -104,6 +104,8 @@ _CMAKE_CACHE_ENTRIES_CROSSTOOL = { "CMAKE_SYSTEM_NAME": struct(value = "CMAKE_SYSTEM_NAME", replace = True), "CMAKE_AR": struct(value = "CMAKE_AR", replace = True), "CMAKE_RANLIB": struct(value = "CMAKE_RANLIB", replace = True), + "CMAKE_C_ARCHIVE_CREATE": struct(value = "CMAKE_C_ARCHIVE_CREATE", replace = False), + "CMAKE_CXX_ARCHIVE_CREATE": struct(value = "CMAKE_CXX_ARCHIVE_CREATE", replace = False), "CMAKE_CXX_LINK_EXECUTABLE": struct(value = "CMAKE_CXX_LINK_EXECUTABLE", replace = True), "CMAKE_C_FLAGS": struct(value = "CMAKE_C_FLAGS_INIT", replace = False), "CMAKE_CXX_FLAGS": struct(value = "CMAKE_CXX_FLAGS_INIT", replace = False), @@ -233,6 +235,9 @@ def _fill_crossfile_from_toolchain(workspace_name, target_os, tools, flags): if tools.cxx_linker_static: dict["CMAKE_AR"] = _absolutize(workspace_name, tools.cxx_linker_static, True) + if tools.cxx_linker_static.endswith("/libtool"): + dict["CMAKE_C_ARCHIVE_CREATE"] = " -static -o " + dict["CMAKE_CXX_ARCHIVE_CREATE"] = " -static -o " if tools.cxx_linker_executable and tools.cxx_linker_executable != tools.cxx: normalized_path = _absolutize(workspace_name, tools.cxx_linker_executable)