aboutsummaryrefslogtreecommitdiff
path: root/tools/windows.py
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-09-23 22:25:30 +0200
committer GitHub <noreply@github.com>2023-09-23 22:25:30 +0200
commit5ff04702985dcaefa891266417d77ac4e197cfeb (patch)
tree6b3cbbc9f6d5e793d6c337023e95d94105ca888f /tools/windows.py
parent977661f6f4301be19fa64abfc6cda5040c3899b1 (diff)
parent348668afee5bfbbc376d0615b51dca210213c1ec (diff)
Merge pull request #17 from OpenVicProject/outsource/extras
Diffstat (limited to 'tools/windows.py')
-rw-r--r--tools/windows.py73
1 files changed, 0 insertions, 73 deletions
diff --git a/tools/windows.py b/tools/windows.py
deleted file mode 100644
index 0fd86a6..0000000
--- a/tools/windows.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copied from https://github.com/godotengine/godot-cpp/blob/edf02f83194b58408ca241459c986e32c52fd9c7/tools/windows.py
-import sys
-
-import my_spawn
-
-from SCons.Tool import msvc, mingw
-from SCons.Variables import *
-
-
-def options(opts):
- opts.Add(BoolVariable("use_mingw", "Use the MinGW compiler instead of MSVC - only effective on Windows", False))
- opts.Add(BoolVariable("use_clang_cl", "Use the clang driver instead of MSVC - only effective on Windows", False))
-
-
-def exists(env):
- return True
-
-
-def generate(env):
- base = None
- if not env["use_mingw"] and msvc.exists(env):
- if env["arch"] == "x86_64":
- env["TARGET_ARCH"] = "amd64"
- elif env["arch"] == "x86_32":
- env["TARGET_ARCH"] = "x86"
- env["is_msvc"] = True
-
- # MSVC, linker, and archiver.
- msvc.generate(env)
- env.Tool("mslib")
- env.Tool("mslink")
-
- env.Append(CPPDEFINES=["TYPED_METHOD_BIND", "NOMINMAX"])
- env.Append(CCFLAGS=["/EHsc", "/utf-8"])
- env.Append(LINKFLAGS=["/WX"])
-
- if env["use_clang_cl"]:
- env["CC"] = "clang-cl"
- env["CXX"] = "clang-cl"
-
- elif sys.platform == "win32" or sys.platform == "msys":
- env["use_mingw"] = True
- mingw.generate(env)
- # Don't want lib prefixes
- env["IMPLIBPREFIX"] = ""
- env["SHLIBPREFIX"] = ""
- # Want dll suffix
- env["SHLIBSUFFIX"] = ".dll"
- # Long line hack. Use custom spawn, quick AR append (to avoid files with the same names to override each other).
- my_spawn.configure(env)
-
- else:
- env["use_mingw"] = True
- # Cross-compilation using MinGW
- prefix = "i686" if env["arch"] == "x86_32" else env["arch"]
- env["CXX"] = prefix + "-w64-mingw32-g++"
- env["CC"] = prefix + "-w64-mingw32-gcc"
- env["AR"] = prefix + "-w64-mingw32-ar"
- env["RANLIB"] = prefix + "-w64-mingw32-ranlib"
- env["LINK"] = prefix + "-w64-mingw32-g++"
- # Want dll suffix
- env["SHLIBSUFFIX"] = ".dll"
-
- # These options are for a release build even using target=debug
- env.Append(CCFLAGS=["-O3", "-Wwrite-strings"])
- env.Append(
- LINKFLAGS=[
- "--static",
- "-Wl,--no-undefined",
- "-static-libgcc",
- "-static-libstdc++",
- ]
- )