File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1313
1414__version__ = "0.0.1"
1515
16- # Windows strips quotes
17- wrap = r'\"{}\"' if sys .platform .startswith ("win" ) else '"{}"'
18-
1916# The main interface is through Pybind11Extension.
2017# * You can add cxx_std=11/14/17, and then build_ext can be removed.
2118# * You can set include_pybind11=false to add the include directory yourself,
2926 Pybind11Extension ("python_example" ,
3027 ["src/main.cpp" ],
3128 # Example: passing in the version to the compiled code
32- define_macros = [('VERSION_INFO' , wrap . format ( __version__ ) )],
29+ define_macros = [('VERSION_INFO' , __version__ )],
3330 ),
3431]
3532
Original file line number Diff line number Diff line change 11#include < pybind11/pybind11.h>
22
3+ #define STRINGIFY (x ) #x
4+
35int add (int i, int j) {
46 return i + j;
57}
@@ -33,7 +35,7 @@ PYBIND11_MODULE(python_example, m) {
3335 )pbdoc" );
3436
3537#ifdef VERSION_INFO
36- m.attr (" __version__" ) = VERSION_INFO;
38+ m.attr (" __version__" ) = STRINGIFY ( VERSION_INFO) ;
3739#else
3840 m.attr (" __version__" ) = " dev" ;
3941#endif
You can’t perform that action at this time.
0 commit comments