Skip to content

Commit

Permalink
Fix stringification of version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Kogler committed Feb 16, 2021
1 parent b38b8c9 commit 257c2c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
env:
# Python 2.7 on Windows does not support C++11 by default, skipping it since its EOL anyways.
CIBW_SKIP: cp27-win*

- name: Show files
run: ls -lh wheelhouse
shell: bash
Expand Down
6 changes: 5 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#include <pybind11/numpy.h>
#include <mapbox/earcut.hpp>

#define IDENT_TO_STR(x) #x
#define MACRO_TO_STR(x) IDENT_TO_STR(x)

namespace py = pybind11;

#include <iostream>
Expand Down Expand Up @@ -85,7 +88,8 @@ PYBIND11_MODULE(mapbox_earcut, m)
m.def("triangulate_float64", &triangulate<double, uint32_t>);

#ifdef VERSION_INFO
m.attr("__version__") = "VERSION_INFO";

m.attr("__version__") = MACRO_TO_STR(VERSION_INFO) ;
#else
m.attr("__version__") = "dev";
#endif
Expand Down

0 comments on commit 257c2c8

Please sign in to comment.