summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorD.J. Sutherland <djs@djsutherland.ml>2020-05-13 14:21:54 -0500
committerD.J. Sutherland <djs@djsutherland.ml>2020-05-13 14:39:03 -0500
commita91d88847531e3d9b889881770db9dcbb4b41389 (patch)
treec1f125232819536b529bdcb66735015806e96766 /setup.py
parenta9a0050fb15124b61bd548d20a95ebc463eec1f4 (diff)
only mangle CC/etc if on mac and not told not to
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 91c24d9..58c7da5 100755
--- a/setup.py
+++ b/setup.py
@@ -14,9 +14,6 @@ import subprocess
here = path.abspath(path.dirname(__file__))
-os.environ["CC"] = "g++"
-os.environ["CXX"] = "g++"
-
# dirty but working
__version__ = re.search(
r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', # It excludes inline comment too
@@ -39,7 +36,9 @@ if 'clean' in sys.argv[1:]:
# add platform dependant optional compilation argument
-if sys.platform.startswith('darwin'):
+if sys.platform.startswith('darwin') and not os.environ.get('POT_LEAVE_CC', ''):
+ os.environ["CC"] = "g++"
+ os.environ["CXX"] = "g++"
opt_arg.append("-stdlib=libc++")
sdk_path = subprocess.check_output(['xcrun', '--show-sdk-path'])
os.environ['CFLAGS'] = '-isysroot "{}"'.format(sdk_path.rstrip().decode("utf-8"))