diff --git a/setup.py b/setup.py
index 53e12da53c..a9e2dfdf35 100755
--- a/setup.py
+++ b/setup.py
@@ -566,7 +566,9 @@ tseries_depends = np_datetime_headers
 
 ext_data = {
     "_libs.algos": {"pyxfile": "_libs/algos", "depends": _pxi_dep["algos"]},
-    "_libs.groupby": {"pyxfile": "_libs/groupby", "depends": _pxi_dep["groupby"]},
+    "_libs.groupby": {"pyxfile": "_libs/groupby",
+                      "depends": _pxi_dep["groupby"],
+                      'extra_compile_args': ['/Od'] if is_platform_windows() else []},
     "_libs.hashing": {"pyxfile": "_libs/hashing", "include": [], "depends": []},
     "_libs.hashtable": {
         "pyxfile": "_libs/hashtable",
@@ -735,6 +737,8 @@ for name, data in ext_data.items():
     sources.extend(data.get("sources", []))
 
     include = data.get("include", common_include)
+    _extra_compile_args = extra_compile_args[:]
+    _extra_compile_args.extend(data.get('extra_compile_args', []))
 
     obj = Extension(
         "pandas.{name}".format(name=name),
@@ -743,7 +747,7 @@ for name, data in ext_data.items():
         include_dirs=include,
         language=data.get("language", "c"),
         define_macros=data.get("macros", macros),
-        extra_compile_args=extra_compile_args,
+        extra_compile_args=_extra_compile_args,
         extra_link_args=extra_link_args,
     )
 
