Skip to content

Commit

Permalink
[SCons] Remove Cygwin support
Browse files Browse the repository at this point in the history
Cygwin support is untested and Cygwin has uncertain usage for Cantera.
Modern replacements such as the Windows Subsystem for Linux v2 (WSL2)
should be used instead.
  • Loading branch information
ischoegl committed Aug 25, 2022
1 parent 60b3fb6 commit 1472703
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
6 changes: 2 additions & 4 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ config_options = [
""",
{
"cl": "/EHsc",
"Cygwin": "-std=gnu++11", # See http://stackoverflow.com/questions/18784112
"default": "-std=c++11"
}),
Option(
Expand Down Expand Up @@ -760,7 +759,8 @@ env = Environment(tools=toolchain+["textfile", "subst", "recursiveInstall", "wix
env["OS"] = platform.system()
env["OS_BITS"] = int(platform.architecture()[0][:2])
if "cygwin" in env["OS"].lower():
env["OS"] = "Cygwin" # remove Windows version suffix
logger.error(f"Error: Operating system {os.name!r} is no longer supported.")
sys.exit(1)

if "FRAMEWORKS" not in env:
env["FRAMEWORKS"] = []
Expand Down Expand Up @@ -800,8 +800,6 @@ if env["OS"] == "Darwin":
config.select("apple-clang")

if "gcc" in env.subst("$CC") or "gnu-cc" in env.subst("$CC"):
if env["OS"] == "Cygwin":
config.select("Cygwin")
config.select("gcc")

elif env["CC"] == "cl": # Visual Studio
Expand Down
3 changes: 0 additions & 3 deletions interfaces/cython/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ elif localenv['OS'] == 'Windows':
# See https://github.com/python/cpython/pull/11283
if py_version_full < parse_version("3.7.3"):
localenv.Append(CPPDEFINES={"_hypot": "hypot"})
elif localenv['OS'] == 'Cygwin':
# extract 'pythonX.Y' from 'libpythonX.Y.dll.a'
localenv.Append(LIBS=pylib[3:-6])

if "numpy_1_7_API" in localenv:
localenv.Append(CPPDEFINES="NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION")
Expand Down
7 changes: 0 additions & 7 deletions site_scons/buildutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,10 +1284,3 @@ def get_pip_install_location(
print(json.dumps(scheme))
""")
return json.loads(get_command_output(python_cmd, "-c", install_script))


# Monkey patch for SCons Cygwin bug
# See https://github.com/SCons/scons/issues/2664
if "cygwin" in platform.system().lower():
import SCons.Node.FS
SCons.Node.FS._my_normcase = lambda x: x
2 changes: 1 addition & 1 deletion test_problems/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ localenv['ENV']['CANTERA_DATA'] = (Dir('#build/data').abspath + os.pathsep +
Dir('#test/data').abspath)

# Add build/lib in order to find Cantera shared library
if env['OS'] == 'Windows' or env['OS'] == 'Cygwin':
if env["OS"] == "Windows":
localenv.PrependENVPath('PATH', Dir('#build/lib').abspath)
elif env['OS'] == 'Darwin':
localenv.PrependENVPath('DYLD_LIBRARY_PATH', Dir('#build/lib').abspath)
Expand Down

0 comments on commit 1472703

Please sign in to comment.