Skip to content

Commit

Permalink
Going back to sane setup
Browse files Browse the repository at this point in the history
  • Loading branch information
msoos committed Oct 14, 2023
1 parent 0f48d3c commit 3f17d07
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions python/src/pycryptosat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,16 @@ MODULE_INIT_FUNC(pycryptosat)

// Add the version string so users know what version of CryptoMiniSat
// they're using.
#if defined(_MSC_VER)
if (PyModule_AddStringConstant(m, "__version__", "unknown -- can't use /D to define strings in Windows, pypi and Windows CLI are both broken") {
Py_DECREF(m);
return NULL;
}
if (PyModule_AddStringConstant(m, "VERSION", "unknown -- can't use /D to define strings in Windows, pypi and Windows CLI are both broken") == -1) {
Py_DECREF(m);
return NULL;
}
#else
if (PyModule_AddStringConstant(m, "__version__", CMS_FULL_VERSION) == -1) {
Py_DECREF(m);
return NULL;
Expand All @@ -904,6 +914,8 @@ MODULE_INIT_FUNC(pycryptosat)
Py_DECREF(m);
return NULL;
}
#endif


// Add the Solver type.
Py_INCREF(&pycryptosat_SolverType);
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ def _parse_toml(pyproject_path):
def gen_modules(version):

if platform == "win32" or platform == "cygwin":
extra_compile_args_val = ['-I../', '-Isrc/', '/std:c++17', "/DCMS_FULL_VERSION=\\\"cms-"+version+"\\\""]
extra_compile_args_val = ['-I../', '-Isrc/', '/std:c++17', "/DCMS_FULL_VERSION=\""+version+"\""]
define_macros_val = [("TRACE", "")]

else:
extra_compile_args_val = ['-I../', '-Isrc/', '-std=c++17']
define_macros_val = [("TRACE", ""), ("CMS_FULL_VERSION", "\"cms-"+version+"\"")]
define_macros_val = [("TRACE", ""), ("CMS_FULL_VERSION", "\""+version+"\"")]

modules = Extension(
name = "pycryptosat",
Expand Down

0 comments on commit 3f17d07

Please sign in to comment.