Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/mypaint/lib/SConscript
blob: 7f1f5301476b9798604c6ae69f9f45535affa05f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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')