Compiling on windows with VC2015

pull/16/head
BastiaanOlij 2017-07-13 23:02:41 +10:00
parent a3bcda958e
commit 64e0d4ff4b
1 changed files with 12 additions and 17 deletions

View File

@ -3,12 +3,8 @@ import os, subprocess
# Local dependency paths, adapt them to your setup # Local dependency paths, adapt them to your setup
godot_headers_path = "../godot_headers/" godot_headers_path = ARGUMENTS.get("headers", "../godot_headers/")
godot_bin_path = "../godot_fork/bin/" godot_bin_path = ARGUMENTS.get("godotpath", "../godot_fork/bin/")
# for windows
godot_lib_path = "../godot_fork/bin/"
env = Environment() env = Environment()
@ -18,25 +14,27 @@ if ARGUMENTS.get("use_llvm", "no") == "yes":
target = ARGUMENTS.get("target", "core") target = ARGUMENTS.get("target", "core")
platform = ARGUMENTS.get("p", "linux") platform = ARGUMENTS.get("p", "linux")
godot_name = "godot." + ("x11" if platform == "linux" else platform) + ".tools.64" godot_name = "godot." + ("x11" if platform == "linux" else platform) + ".tools.64"
def add_sources(sources, directory): def add_sources(sources, directory):
for file in os.listdir(directory): for file in os.listdir(directory):
if file.endswith('.cpp'): if file.endswith('.cpp'):
sources.append(directory + '/' + file) sources.append(directory + '/' + file)
# put stuff that is the same for all first, saves duplication
if platform == "osx": if platform == "osx":
env.Append(CCFLAGS = ['-g','-O3', '-std=c++14', '-arch', 'x86_64']) env.Append(CCFLAGS = ['-g','-O3', '-std=c++14', '-arch', 'x86_64'])
env.Append(LINKFLAGS = ['-arch', 'x86_64', '-framework', 'Cocoa', '-Wl,-undefined,dynamic_lookup']) env.Append(LINKFLAGS = ['-arch', 'x86_64', '-framework', 'Cocoa', '-Wl,-undefined,dynamic_lookup'])
elif platform == "linux":
env.Append(CCFLAGS = ['-g','-O3', '-std=c++14'])
env.Append(LINKFLAGS = ['-Wl,-R,\'$$ORIGIN\''])
elif platform == "windows":
# need to add detection of msvc vs mingw, this is for msvc...
env.Append(CCFLAGS = ['/MD', '/WX', '/O2', '/EHsc', '/nologo'])
env.Append(LINKFLAGS = ['/WX'])
godot_lib_path = ARGUMENTS.get("godotlibpath", godot_bin_path)
if target == "core": if target == "core":
if platform == "linux":
env.Append(CCFLAGS = ['-g','-O3', '-std=c++14'])
env.Append(CPPPATH=['include/core', godot_headers_path]) env.Append(CPPPATH=['include/core', godot_headers_path])
if platform == "windows": if platform == "windows":
@ -82,9 +80,6 @@ elif target == "bindings":
else: else:
env.Append(CCFLAGS = ['-Wno-write-strings', '-Wno-return-local-addr']) env.Append(CCFLAGS = ['-Wno-write-strings', '-Wno-return-local-addr'])
env.Append(CCFLAGS = ['-g','-O3', '-std=c++14'])
env.Append(LINKFLAGS = ['-Wl,-R,\'$$ORIGIN\''])
env.Append(CPPPATH=['.', godot_headers_path, 'include', 'include/core']) env.Append(CPPPATH=['.', godot_headers_path, 'include', 'include/core'])
if platform == "windows": if platform == "windows":