From 1a5b2576f731f38c9d73f1ff011a876063d61a6f Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Fri, 30 Apr 2021 11:07:02 +0400 Subject: [PATCH] wscript: added support for "Edit and Continue" MSVC feature --- scripts/waifulib/compiler_optimizations.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/waifulib/compiler_optimizations.py b/scripts/waifulib/compiler_optimizations.py index 90dbcbe5..5c911eed 100644 --- a/scripts/waifulib/compiler_optimizations.py +++ b/scripts/waifulib/compiler_optimizations.py @@ -41,19 +41,22 @@ LINKFLAGS = { 'sanitize': { 'clang': ['-fsanitize=undefined', '-fsanitize=address'], 'gcc': ['-fsanitize=undefined', '-fsanitize=address'], + }, + 'debug': { + 'msvc': ['/INCREMENTAL', '/SAFESEH:NO'] } } CFLAGS = { 'common': { # disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP - 'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS', '/Zc:threadSafeInit-', '/MT'], + 'msvc': ['/D_USING_V110_SDK71_', '/FS', '/Zc:threadSafeInit-', '/MT'], 'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden'], 'gcc': ['-g', '-fvisibility=hidden'], 'owcc': ['-fno-short-enum', '-ffloat-store', '-g3'] }, 'fast': { - 'msvc': ['/O2', '/Oy'], + 'msvc': ['/O2', '/Oy', '/Zi'], 'gcc': { '3': ['-O3', '-fomit-frame-pointer'], 'default': ['-Ofast', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'] @@ -62,29 +65,29 @@ CFLAGS = { 'default': ['-O3'] }, 'fastnative': { - 'msvc': ['/O2', '/Oy'], + 'msvc': ['/O2', '/Oy', '/Zi'], 'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'], 'clang': ['-Ofast', '-march=native'], 'default': ['-O3'] }, 'release': { - 'msvc': ['/O2'], + 'msvc': ['/O2', '/Zi'], 'owcc': ['-O3', '-foptimize-sibling-calls', '-fomit-leaf-frame-pointer', '-fomit-frame-pointer', '-fschedule-insns', '-funsafe-math-optimizations', '-funroll-loops', '-frerun-optimizer', '-finline-functions', '-finline-limit=512', '-fguess-branch-probability', '-fno-strict-aliasing', '-floop-optimize'], 'default': ['-O3'] }, 'debug': { - 'msvc': ['/Od'], + 'msvc': ['/Od', '/ZI'], 'owcc': ['-O0', '-fno-omit-frame-pointer', '-funwind-tables', '-fno-omit-leaf-frame-pointer'], 'default': ['-O0'] }, 'sanitize': { - 'msvc': ['/Od', '/RTC1'], + 'msvc': ['/Od', '/RTC1', '/Zi'], 'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address'], 'clang': ['-O0', '-fsanitize=undefined', '-fsanitize=address'], 'default': ['-O0'] }, 'nooptimize': { - 'msvc': ['/Od'], + 'msvc': ['/Od', '/Zi'], 'default': ['-O0'] } }