diff options
Diffstat (limited to 'mypaint/lib/SConscript')
-rw-r--r-- | mypaint/lib/SConscript | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mypaint/lib/SConscript b/mypaint/lib/SConscript new file mode 100644 index 0000000..7f1f530 --- /dev/null +++ b/mypaint/lib/SConscript @@ -0,0 +1,22 @@ +Import('env') +import sys + +# For the record: I know that scons supports swig. But it doesn't scan for #include in the generated code. +# +# I have given up. Scons just can't get the dependencies right with those +# code generators. Let's give scons a "normal" c++ project to dependency-scan. +if env.Execute('swig -o mypaintlib_wrap.cpp -noproxydel -python -c++ mypaintlib.i'): + Exit(1) +env.Clean('.', 'mypaintlib_wrap.cpp') +env.Clean('.', 'mypaintlib.py') + +# python extension module +src = 'mypaintlib_wrap.cpp' +if sys.platform == "win32": # there 's a better way to do this + module = env.SharedLibrary('_mypaintlib', Split(src), SHLIBPREFIX="", SHLIBSUFFIX=".pyd") +elif sys.platform == "darwin": + module = env.SharedLibrary('_mypaintlib', Split(src), SHLIBPREFIX="", SHLIBSUFFIX=".so") +else: + module = env.SharedLibrary('_mypaintlib', Split(src), SHLIBPREFIX="") + +Return('module') |