summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2021-10-28 17:58:05 -0500
committerJason Madden <jamadden@gmail.com>2021-10-28 17:58:05 -0500
commit83a1093f0459e88ce470ac0e2fcbc01f48ec75c5 (patch)
treeea170141770fc75d796d9a67c373165069ac8744 /setup.py
parentd10b3f255137b965f8e64f5524bb9f4f92323e70 (diff)
downloadgreenlet-83a1093f0459e88ce470ac0e2fcbc01f48ec75c5.tar.gz
Enable some debug options on MSVC.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index b4c838f..157ac16 100755
--- a/setup.py
+++ b/setup.py
@@ -52,8 +52,23 @@ elif sys.platform == 'win32':
# /EHsc is suggested, as /EHa isn't supposed to be linked to other things not built
# with it.
# See https://docs.microsoft.com/en-us/cpp/build/reference/eh-exception-handling-model?view=msvc-160
- handler = "/EHa"
+ handler = "/EHsc"
cpp_compile_args.append(handler)
+ # disable most optimizations
+ cpp_compile_args.append('/Od')
+ # enable assertions
+ cpp_compile_args.append('/UNDEBUG')
+ # enable more compile-time warnings
+ cpp_compile_args.append('/Wall')
+ # link with the debug C runtime
+ cpp_compile_args.append('/MDd')
+ # Support fiber-safe thread-local storage: "the compiler mustn't
+ # cache the address of the TLS array, or optimize it as a common
+ # subexpression across a function call" This would probably solve
+ # some of the issues we had with MSVC caching the thread local
+ # variables on the stack, leading to having to split some
+ # functions up.
+ cpp_compile_args.append("/GT")
def readfile(filename):
with open(filename, 'r') as f: # pylint:disable=unspecified-encoding