summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/context_gl_win.cpp4
-rw-r--r--platform/windows/detect.py28
2 files changed, 23 insertions, 9 deletions
diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp
index d312fbcb12..a158237418 100644
--- a/platform/windows/context_gl_win.cpp
+++ b/platform/windows/context_gl_win.cpp
@@ -106,9 +106,9 @@ Error ContextGL_Win::initialize() {
PFD_SUPPORT_OPENGL | // Format Must Support OpenGL
PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
- 24,
+ OS::get_singleton()->is_layered_allowed() ? 32 : 24,
0, 0, 0, 0, 0, 0, // Color Bits Ignored
- 0, // No Alpha Buffer
+ OS::get_singleton()->is_layered_allowed() ? 8 : 0, // Alpha Buffer
0, // Shift Bit Ignored
0, // No Accumulation Buffer
0, 0, 0, 0, // Accumulation Bits Ignored
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 05806d2fe8..cacb573236 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -166,12 +166,18 @@ def configure_msvc(env, manual_msvc_config):
# Build type
if (env["target"] == "release"):
- env.Append(CCFLAGS=['/O2'])
+ if (env["optimize"] == "speed"): #optimize for speed (default)
+ env.Append(CCFLAGS=['/O2'])
+ else: # optimize for size
+ env.Append(CCFLAGS=['/O1'])
env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS'])
env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup'])
elif (env["target"] == "release_debug"):
- env.Append(CCFLAGS=['/O2'])
+ if (env["optimize"] == "speed"): #optimize for speed (default)
+ env.Append(CCFLAGS=['/O2'])
+ else: # optimize for size
+ env.Append(CCFLAGS=['/O1'])
env.AppendUnique(CPPDEFINES = ['DEBUG_ENABLED'])
env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
@@ -247,10 +253,14 @@ def configure_mingw(env):
if (env["target"] == "release"):
env.Append(CCFLAGS=['-msse2'])
- if (env["bits"] == "64"):
- env.Append(CCFLAGS=['-O3'])
- else:
- env.Append(CCFLAGS=['-O2'])
+ if (env["optimize"] == "speed"): #optimize for speed (default)
+ if (env["bits"] == "64"):
+ env.Append(CCFLAGS=['-O3'])
+ else:
+ env.Append(CCFLAGS=['-O2'])
+ else: #optimize for size
+ env.Prepend(CCFLAGS=['-Os'])
+
env.Append(LINKFLAGS=['-Wl,--subsystem,windows'])
@@ -265,7 +275,11 @@ def configure_mingw(env):
env.Prepend(CCFLAGS=['-g1'])
if (env["debug_symbols"] == "full"):
env.Prepend(CCFLAGS=['-g2'])
-
+ if (env["optimize"] == "speed"): #optimize for speed (default)
+ env.Append(CCFLAGS=['-O2'])
+ else: #optimize for size
+ env.Prepend(CCFLAGS=['-Os'])
+
elif (env["target"] == "debug"):
env.Append(CCFLAGS=['-g3', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])