Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1064 and LINKFLAGS typo for "-static" #1082

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions tools/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,26 @@ def generate(env):
env["SHLIBPREFIX"] = ""
# Want dll suffix
env["SHLIBSUFFIX"] = ".dll"

env.Append(CCFLAGS=["-Wwrite-strings"])
env.Append(
LINKFLAGS=[
"-static",
"-Wl,--no-undefined",
"-static-libgcc",
"-static-libstdc++",
]
)

# 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"]
prefix = "i686"
if env["arch"] == "x86_64":
prefix = "x86_64"
env["CXX"] = prefix + "-w64-mingw32-g++"
env["CC"] = prefix + "-w64-mingw32-gcc"
env["AR"] = prefix + "-w64-mingw32-ar"
Expand All @@ -60,11 +73,10 @@ def generate(env):
# 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(CCFLAGS=["-Wwrite-strings"])
env.Append(
LINKFLAGS=[
"--static",
"-static",
"-Wl,--no-undefined",
"-static-libgcc",
"-static-libstdc++",
Expand Down