Bug 1906596 - Move WIN32_CONSOLE_EXE_LDFLAGS and WIN32_GUI_EXE_LDFLAGS from old-configure to moz.configure r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D215935
This commit is contained in:
serge-sans-paille 2024-07-16 22:14:35 +00:00
Родитель 68a1dd3f3c
Коммит bd5f7c69a9
4 изменённых файлов: 19 добавлений и 23 удалений

Просмотреть файл

@ -401,11 +401,9 @@ def add_gnu_specific_dso_flags(
dso_flags.ldopts.extend(ldopts)
@depends(
dso_flags, target, win32_subsystem_version, when=~building_with_gnu_compatible_cc
)
def add_non_gnu_dso_flags(dso_flags, target, win32_subsystem_version):
ldopts = [f"-SUBSYSTEM:WINDOWS,{win32_subsystem_version}"]
@depends(dso_flags, target, when=~building_with_gnu_compatible_cc)
def add_non_gnu_dso_flags(dso_flags, target):
ldopts = ["-SUBSYSTEM:WINDOWS,{}".format(win32_subsystem_version())]
if target.cpu == "x86":
ldopts.append("-MACHINE:X86")
if target.cpu == "x86_64":

Просмотреть файл

@ -579,7 +579,23 @@ with only_when(depends(c_compiler)(lambda c: c.type == "clang-cl")):
set_define("HAVE_SEH_EXCEPTIONS", True)
set_define("HAVE_IO_H", True)
def win32_subsystem_version():
return "10.0"
set_config(
"WIN32_CONSOLE_EXE_LDFLAGS",
"-SUBSYSTEM:CONSOLE,{}".format(win32_subsystem_version()),
)
set_config(
"WIN32_GUI_EXE_LDFLAGS",
"-SUBSYSTEM:WINDOWS,{}".format(win32_subsystem_version()),
)
with only_when(depends(c_compiler)(lambda c: c.type != "clang-cl")):
# strsafe.h on mingw uses macros for function deprecation that pollutes namespace
# causing problems with local implementations with the same name.
set_define("STRSAFE_NO_DEPRECATE", True)
set_config("WIN32_CONSOLE_EXE_LDFLAGS", "-mconsole")
set_config("WIN32_GUI_EXE_LDFLAGS", "-mwindows")

Просмотреть файл

@ -105,13 +105,7 @@ case "$target" in
LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
MOZ_OPTIMIZE_FLAGS="-O2"
WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
WIN32_GUI_EXE_LDFLAGS=-mwindows
else
WIN32_SUBSYSTEM_VERSION=10.0
WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
CFLAGS="$CFLAGS -Gy -Zc:inline"
CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
if test "$TARGET_CPU" = "x86";then
@ -287,9 +281,6 @@ AC_SUBST_LIST(OS_LDFLAGS)
AC_SUBST(HOST_CC)
AC_SUBST(HOST_CXX)
AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
dnl Set various defines and substitutions
dnl ========================================================

Просмотреть файл

@ -98,16 +98,10 @@ case "$target" in
MOZ_OPTIMIZE_FLAGS="-O2"
WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
WIN32_GUI_EXE_LDFLAGS=-mwindows
# Silence problematic clang warnings
CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
else
WIN32_SUBSYSTEM_VERSION=10.0
WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
CFLAGS="$CFLAGS -Gy -Zc:inline"
CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
if test "$TARGET_CPU" = "x86"; then
@ -432,9 +426,6 @@ AC_SUBST_LIST(OS_LDFLAGS)
AC_SUBST(HOST_CC)
AC_SUBST(HOST_CXX)
AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
dnl Set various defines and substitutions
dnl ========================================================