Skip to content

Commit

Permalink
Bug 1941695 - Rename USE_STATIC_LIBS. r=firefox-build-system-reviewer…
Browse files Browse the repository at this point in the history
…s,application-update-reviewers,media-playback-reviewers,padenot,bytesized,sergesanspaille

The name is confusing, as it doesn't apply to all libraries, and only on
Windows non-mingw.

Differential Revision: https://phabricator.services.mozilla.com/D234260
  • Loading branch information
glandium committed Jan 20, 2025
1 parent 74d9dd2 commit 1857d81
Show file tree
Hide file tree
Showing 22 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build/pure_virtual/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SOURCES += ["pure_virtual.c"]

FORCE_STATIC_LIB = True

USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

# Build a real library so that the linker can remove it if the symbol
# is never used.
Expand Down
2 changes: 1 addition & 1 deletion build/win32/crashinjectdll/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ SharedLibrary("crashinjectdll")

DEFFILE = "crashinjectdll.def"

USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True
NO_PGO = True
2 changes: 1 addition & 1 deletion build/win32/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if CONFIG["ENABLE_TESTS"]:
SOURCES += [
"crashinject.cpp",
]
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

NO_PGO = True

Expand Down
2 changes: 1 addition & 1 deletion dom/media/fake-cdm/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if CONFIG["OS_ARCH"] == "WINNT":
"user32",
]

USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True
NoVisibilityFlags()
# Don't use STL wrappers; this isn't Gecko code
DisableStlWrapping()
Expand Down
2 changes: 1 addition & 1 deletion dom/media/gmp-plugin-openh264/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SOURCES += [

SharedLibrary("fakeopenh264")

USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True
NoVisibilityFlags()
# Don't use STL wrappers; this isn't Gecko code
DisableStlWrapping()
Expand Down
2 changes: 1 addition & 1 deletion modules/libmar/sign/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ LOCAL_INCLUDES += [
DEFINES["MAR_NSS"] = True

if CONFIG["OS_ARCH"] == "WINNT":
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True
2 changes: 1 addition & 1 deletion modules/libmar/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ if CONFIG["MOZ_BUILD_APP"] != "tools/update-packaging":
FORCE_STATIC_LIB = True

if CONFIG["OS_ARCH"] == "WINNT":
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True
2 changes: 1 addition & 1 deletion modules/libmar/tool/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if CONFIG["MOZ_BUILD_APP"] != "tools/update-packaging":
DEFINES["MAR_NSS"] = True

if CONFIG["OS_ARCH"] == "WINNT":
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

OS_LIBS += [
"ws2_32",
Expand Down
2 changes: 1 addition & 1 deletion modules/libmar/verify/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ UNIFIED_SOURCES += [
FORCE_STATIC_LIB = True

if CONFIG["OS_ARCH"] == "WINNT":
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True
elif CONFIG["OS_ARCH"] == "Darwin" and not CONFIG["MOZ_USE_NSS_FOR_MAR"]:
UNIFIED_SOURCES += [
"MacVerifyCrypto.cpp",
Expand Down
2 changes: 1 addition & 1 deletion modules/xz-embedded/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ DEFINES['XZ_DEC_X86'] = 1
DEFINES['XZ_USE_CRC64'] = 1

if CONFIG['OS_ARCH'] == 'WINNT':
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

Library('xz-embedded')
2 changes: 1 addition & 1 deletion other-licenses/bsdiff/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if CONFIG['HOST_OS_ARCH'] == 'WINNT':
HOST_OS_LIBS += [
'ws2_32',
]
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

LOCAL_INCLUDES += [
'/toolkit/mozapps/update/updater',
Expand Down
3 changes: 2 additions & 1 deletion python/mozbuild/mozbuild/frontend/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@ def aggregate(files):
"""Whether the library in this directory is a static library.
""",
),
"USE_STATIC_LIBS": (
"USE_STATIC_MSVCRT": (
bool,
bool,
"""Whether the code in this directory is a built against the static
Expand Down Expand Up @@ -3112,6 +3112,7 @@ def Program(name):
DIST_FILES += [ 'foo' ]
""",
"USE_STATIC_LIBS": "Please use the USE_STATIC_MSVCRT variable instead.",
}

# Make sure that all template variables have a deprecation hint.
Expand Down
8 changes: 4 additions & 4 deletions python/mozbuild/mozbuild/frontend/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1311,17 +1311,17 @@ def emit_from_context(self, context):
passthru.variables["NO_DIST_INSTALL"] = True

# Ideally, this should be done in templates, but this is difficult at
# the moment because USE_STATIC_LIBS can be set after a template
# the moment because USE_STATIC_MSVCRT can be set after a template
# returns. Eventually, with context-based templates, it will be
# possible.
if (
context.config.substs.get("OS_ARCH") == "WINNT"
and context.config.substs.get("CC_TYPE") == "clang-cl"
):
use_static_lib = context.get(
"USE_STATIC_LIBS"
use_static_msvcrt = context.get(
"USE_STATIC_MSVCRT"
) and not context.config.substs.get("MOZ_ASAN")
rtl_flag = "-MT" if use_static_lib else "-MD"
rtl_flag = "-MT" if use_static_msvcrt else "-MD"
if context.config.substs.get("MOZ_DEBUG") and not context.config.substs.get(
"MOZ_NO_DEBUG_RTL"
):
Expand Down
2 changes: 1 addition & 1 deletion testing/tools/minidumpwriter/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if CONFIG["ENABLE_TESTS"] and CONFIG["OS_ARCH"] == "WINNT":
SOURCES += [
"minidumpwriter.cpp",
]
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True
if CONFIG["CC_TYPE"] in ("clang", "gcc"):
WIN32_EXE_LDFLAGS += ["-municode"]

Expand Down
2 changes: 1 addition & 1 deletion testing/tools/screenshot/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
SOURCES += [
"win32-screenshot.cpp",
]
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True
if CONFIG["CC_TYPE"] in ("clang", "gcc"):
WIN32_EXE_LDFLAGS += ["-municode"]
OS_LIBS += [
Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/maintenanceservice/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LOCAL_INCLUDES += [
"/toolkit/xre",
]

USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

if CONFIG["CC_TYPE"] == "clang-cl":
WIN32_EXE_LDFLAGS += ["-ENTRY:wmainCRTStartup"]
Expand Down
2 changes: 1 addition & 1 deletion toolkit/crashreporter/mozwer/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ if CONFIG["RUSTC_VERSION"] and CONFIG["RUSTC_VERSION"] >= "1.78.0":
]

DEFFILE = "mozwer.def"
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

SharedLibrary("mozwer")
2 changes: 1 addition & 1 deletion toolkit/mozapps/update/common/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if CONFIG["OS_ARCH"] == "WINNT":
Library("updatecommon")

DEFINES["NS_NO_XPCOM"] = True
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

if CONFIG["DISABLE_UPDATER_AUTHENTICODE_CHECK"]:
DEFINES["DISABLE_UPDATER_AUTHENTICODE_CHECK"] = True
Expand Down
2 changes: 1 addition & 1 deletion toolkit/mozapps/update/tests/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if CONFIG["CC_TYPE"] == "clang-cl":
if CONFIG["OS_ARCH"] == "WINNT":
DEFINES["UNICODE"] = True
DEFINES["_UNICODE"] = True
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True
if CONFIG["CC_TYPE"] in ("clang", "gcc"):
WIN32_EXE_LDFLAGS += ["-municode"]

Expand Down
2 changes: 1 addition & 1 deletion toolkit/mozapps/update/updater/bspatch/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

if CONFIG["OS_ARCH"] == "WINNT":
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

EXPORTS += [
"bspatch.h",
Expand Down
2 changes: 1 addition & 1 deletion toolkit/mozapps/update/updater/updater-common.build
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if CONFIG["OS_ARCH"] == "WINNT":
RCINCLUDE = "%supdater.rc" % updater_rel_path
DEFINES["UNICODE"] = True
DEFINES["_UNICODE"] = True
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

# Pick up nsWindowsRestart.cpp
LOCAL_INCLUDES += [
Expand Down
2 changes: 1 addition & 1 deletion toolkit/xre/test/win/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LOCAL_INCLUDES += [
]

DisableStlWrapping()
USE_STATIC_LIBS = True
USE_STATIC_MSVCRT = True

OS_LIBS += [
"advapi32",
Expand Down

0 comments on commit 1857d81

Please sign in to comment.