From 9e52c8c1294740a919c222986b528669fe300b8a Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Mon, 23 Dec 2024 23:25:25 +1030 Subject: [PATCH] Propagate `linkshared` as appropriate This follows up to our previous commit [1], which was a preparation to address the following isssue but accidentally removed 'linkshared' from Mozc's TIP DLL targets. * https://github.com/google/mozc/issues/1108 While a subsequent commit [2] addressed the immediate issue by passing 'static_crt' to 'linkshared', strictly speaking they are two orthogonal concepts. Let's decouple them to avoid future confusions. There must be no immediate change in the final artifacts with this commit right now. [1]: bc546b239bccff494773104e108ba08fcff40d5b [2]: 8d20ea63288e90dc9fd8a2979215166e1a50eab0 --- src/build_defs.bzl | 4 +++- src/win32/custom_action/BUILD.bazel | 1 + src/win32/tip/BUILD.bazel | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/build_defs.bzl b/src/build_defs.bzl index 5c1b9e5e5..59e7affb5 100644 --- a/src/build_defs.bzl +++ b/src/build_defs.bzl @@ -339,6 +339,7 @@ def mozc_win32_cc_prod_binary( deps = [], features = None, linkopts = [], + linkshared = False, cpu = CPU.X64, static_crt = False, tags = MOZC_TAGS.WIN_ONLY, @@ -362,6 +363,7 @@ def mozc_win32_cc_prod_binary( deps: deps to build the executable. features: features to be passed to mozc_cc_binary. linkopts: linker options to build the executable. + linkshared: True if the target is a shared library (DLL). cpu: optional. The target CPU architecture. static_crt: optional. True if the target should be built with static CRT. tags: optional. Tags for both the library and unit test targets. @@ -377,7 +379,7 @@ def mozc_win32_cc_prod_binary( deps = deps, features = features, linkopts = linkopts, - linkshared = static_crt, + linkshared = linkshared, tags = tags, target_compatible_with = target_compatible_with, visibility = visibility, diff --git a/src/win32/custom_action/BUILD.bazel b/src/win32/custom_action/BUILD.bazel index b17fbd488..d812f4deb 100644 --- a/src/win32/custom_action/BUILD.bazel +++ b/src/win32/custom_action/BUILD.bazel @@ -46,6 +46,7 @@ mozc_win32_cc_prod_binary( "Mozc": "mozc_installer_helper.dll", "GoogleJapaneseInput": "GoogleIMEJaInstallerHelper.dll", }, + linkshared = True, static_crt = True, tags = MOZC_TAGS.WIN_ONLY, target_compatible_with = ["@platforms//os:windows"], diff --git a/src/win32/tip/BUILD.bazel b/src/win32/tip/BUILD.bazel index 459671e80..70a9bf2f3 100644 --- a/src/win32/tip/BUILD.bazel +++ b/src/win32/tip/BUILD.bazel @@ -73,6 +73,7 @@ mozc_win32_cc_prod_binary( "Mozc": "mozc_tip32.dll", "GoogleJapaneseInput": "GoogleIMEJaTIP32.dll", }, + linkshared = True, static_crt = True, tags = MOZC_TAGS.WIN_ONLY, target_compatible_with = ["@platforms//os:windows"], @@ -96,6 +97,7 @@ mozc_win32_cc_prod_binary( "/DEBUG:FULL", "/PDBALTPATH:%_PDB%", ], + linkshared = True, static_crt = True, tags = MOZC_TAGS.WIN_ONLY, target_compatible_with = ["@platforms//os:windows"],