mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Add necessary flags for building MSVC binding
Using C++14 mode is necessary because MSVC's std headers include some C++14 syntax. "utility" is converted to "/utility" to exclude MSVC's "xutility" header.
This commit is contained in:
parent
cfc27b3df5
commit
49f7f54331
1 changed files with 24 additions and 2 deletions
|
@ -21,7 +21,7 @@ COMPILATION_TARGETS = {
|
||||||
# Flags common for all the targets.
|
# Flags common for all the targets.
|
||||||
COMMON_BUILD_KEY: {
|
COMMON_BUILD_KEY: {
|
||||||
"flags": [
|
"flags": [
|
||||||
"-x", "c++", "-std=gnu++0x",
|
"-x", "c++", "-std=c++14",
|
||||||
"-allow-unknown-types", "-no-bitfield-methods",
|
"-allow-unknown-types", "-no-bitfield-methods",
|
||||||
"-no-type-renaming", "-no-namespaced-constants",
|
"-no-type-renaming", "-no-namespaced-constants",
|
||||||
"-DTRACING=1", "-DIMPL_LIBXUL", "-DMOZ_STYLO_BINDINGS=1",
|
"-DTRACING=1", "-DIMPL_LIBXUL", "-DMOZ_STYLO_BINDINGS=1",
|
||||||
|
@ -71,10 +71,11 @@ COMPILATION_TARGETS = {
|
||||||
"gfxFontFamilyList.h", "gfxFontFeatures.h", "imgRequestProxy.h",
|
"gfxFontFamilyList.h", "gfxFontFeatures.h", "imgRequestProxy.h",
|
||||||
"nsIRequest.h", "imgIRequest.h", "CounterStyleManager.h",
|
"nsIRequest.h", "imgIRequest.h", "CounterStyleManager.h",
|
||||||
"nsStyleConsts.h", "nsCSSValue.h", "SheetType.h", "nsIPrincipal.h",
|
"nsStyleConsts.h", "nsCSSValue.h", "SheetType.h", "nsIPrincipal.h",
|
||||||
"nsDataHashtable.h", "nsCSSScanner.h", "utility", "nsTArray",
|
"nsDataHashtable.h", "nsCSSScanner.h", "nsTArray",
|
||||||
"pair", "SheetParsingMode.h", "StaticPtr.h", "nsProxyRelease.h",
|
"pair", "SheetParsingMode.h", "StaticPtr.h", "nsProxyRelease.h",
|
||||||
"mozilla/dom/AnimationEffectReadOnlyBinding.h",
|
"mozilla/dom/AnimationEffectReadOnlyBinding.h",
|
||||||
"/Types.h", # <- Disallow UnionTypes.h
|
"/Types.h", # <- Disallow UnionTypes.h
|
||||||
|
"/utility", # <- Disallow xutility
|
||||||
"nsINode.h", # <- For `NodeFlags`.
|
"nsINode.h", # <- For `NodeFlags`.
|
||||||
],
|
],
|
||||||
"blacklist": [
|
"blacklist": [
|
||||||
|
@ -140,6 +141,27 @@ def platform_dependent_defines():
|
||||||
ret.append("-DOS_LINUX=1")
|
ret.append("-DOS_LINUX=1")
|
||||||
elif system == "Darwin":
|
elif system == "Darwin":
|
||||||
ret.append("-DOS_MACOSX=1")
|
ret.append("-DOS_MACOSX=1")
|
||||||
|
elif system == "Windows":
|
||||||
|
ret.append("-DOS_WIN=1")
|
||||||
|
ret.append("-DWIN32=1")
|
||||||
|
ret.append("-use-msvc-mangling")
|
||||||
|
msvc_platform = os.environ["PLATFORM"]
|
||||||
|
if msvc_platform == "X86":
|
||||||
|
ret.append("--target=i686-pc-win32")
|
||||||
|
elif msvc_platform == "X64":
|
||||||
|
ret.append("--target=x86_64-pc-win32")
|
||||||
|
else:
|
||||||
|
raise Exception("Only MSVC builds are supported on Windows")
|
||||||
|
# For compatibility with MSVC 2015
|
||||||
|
ret.append("-fms-compatibility-version=19")
|
||||||
|
# To enable the builtin __builtin_offsetof so that CRT wouldn't
|
||||||
|
# use reinterpret_cast in offsetof() which is not allowed inside
|
||||||
|
# static_assert().
|
||||||
|
ret.append("-D_CRT_USE_BUILTIN_OFFSETOF")
|
||||||
|
# Enable hidden attribute (which is not supported by MSVC and
|
||||||
|
# thus not enabled by default with a MSVC-compatibile build)
|
||||||
|
# to exclude hidden symbols from the generated file.
|
||||||
|
ret.append("-DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1")
|
||||||
else:
|
else:
|
||||||
raise Exception("Unknown platform")
|
raise Exception("Unknown platform")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue