Skip to content

Commit

Permalink
Set /DEPENDENTLOADFLAG in Bazel Windows build (#1166)
Browse files Browse the repository at this point in the history
This mirrors my previous commit [1] for Windows GYP build so that Bazel
build can also specify appropriate /DEPENDENTLOADFLAG options (#836).

Closes #1114.

 [1]: 18d1bca

PiperOrigin-RevId: 719096319
  • Loading branch information
yukawa authored Jan 24, 2025
1 parent 50357d4 commit 7ea64de
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,16 @@ def mozc_win32_cc_prod_binary(
if cpu in ["@platforms//cpu:x86_32", "@platforms//cpu:x86_64"]:
modified_linkopts.append("/CETCOMPAT")

LOAD_LIBRARY_SEARCH_APPLICATION_DIR = 0x200
LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x800
load_flags = LOAD_LIBRARY_SEARCH_SYSTEM32
if not linkshared:
# We build *.exe with dynamic CRT and deploy CRT DLLs into the
# application dir. Thus LOAD_LIBRARY_SEARCH_APPLICATION_DIR is also
# necessary.
load_flags += LOAD_LIBRARY_SEARCH_APPLICATION_DIR
modified_linkopts.append("/DEPENDENTLOADFLAG:0x%X" % load_flags)

mozc_cc_binary(
name = intermediate_name,
srcs = srcs,
Expand Down

0 comments on commit 7ea64de

Please sign in to comment.