Skip to content

Commit

Permalink
Version for windows python module is very hard
Browse files Browse the repository at this point in the history
  • Loading branch information
msoos committed Oct 14, 2023
1 parent 61b534d commit d673b03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions python/src/pyapproxmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ PyMODINIT_FUNC PyInit_pyapproxmc(void)

// Add the version string
// they're using.
#if defined(_MSC_VER)
#else
if (PyModule_AddStringConstant(m, "__version__", APPMC_FULL_VERSION) == -1) {
Py_DECREF(m);
return NULL;
Expand All @@ -458,6 +460,7 @@ PyMODINIT_FUNC PyInit_pyapproxmc(void)
Py_DECREF(m);
return NULL;
}
#endif

// Add the Counter type
Py_INCREF(&pyapproxmc_CounterType);
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _parse_toml(pyproject_path):

def gen_modules(version):
if platform == "win32" or platform == "cygwin":
extra_compile_args_val = ['/std:c++17', "/DCMS_LOCAL_BUILD=1", "/DAPPMC_FULL_VERSION=\"\\\""+version+"\"\\\""]
extra_compile_args_val = ['/std:c++17', "/DCMS_LOCAL_BUILD=1", "/DAPPMC_FULL_VERSION=\""+version+"\""]
define_macros_val = [("TRACE", "")]

else:
Expand Down

0 comments on commit d673b03

Please sign in to comment.