6 import os, platform, shutil
10 Import(
'MYAPP_VER_MAJOR')
11 Import(
'MYAPP_VER_MINOR')
12 Import(
'MYAPP_VER_COMPILATION')
14 def copyLibBuilder( target, source, env):
15 '''kopiuje biblioteke'''
16 shutil.copy( str(source[0]), str(target[0]) )
20 env.Append( ENV = {
'PATH' : os.environ[
'PATH'] })
22 if(platform.system() ==
"Linux"):
23 env.Append( CPPPATH = [
'/usr/include/python2.7'] )
24 env.Append( LIBPATH = [Dir(
'/usr/lib/python2.7'),
27 env.Append( CPPFLAGS =
'-Wall -pedantic -pthread --std=c++11 ' )
28 env.Append( LINKFLAGS =
'-Wall -pthread --std=c++11 ' )
30 env.Append( LIBS = [
'boost_python',
'boost_thread',
'boost_chrono',
'boost_system' ] )
31 elif(platform.system() ==
"Windows"):
32 env.Append( CPPPATH = [ Dir(
'C:/Boost/include/boost-1_59'),
33 Dir(
'C:/Python27/include'),
34 Dir(
'C:/usr/local/include') ] )
35 env.Append( LIBPATH = [ Dir(
'C:/Boost/lib'),
36 Dir(
'C:/Python27/libs'),
39 env.Append( CPPFLAGS =
' /EHsc /MD /D "WIN32" /D "_CONSOLE" /W4 ' )
40 env.Append( LINKFLAGS =
' /SUBSYSTEM:CONSOLE ' )
42 print platform.system() +
" not supported"
46 if(platform.system() ==
"Linux"):
48 elif(platform.system() ==
"Windows"):
49 env_dll.Append( CPPFLAGS =
' /D "CALC_EXPORTS" ')
52 cpplib = env_dll.SharedLibrary( target =
'calc', source = [
'../calc/src/calc.cpp',
'../calc/src/calcpy.cpp'])
53 if(platform.system() ==
"Linux"):
54 target =
'../build_web/calcpy/calc.so'
55 elif(platform.system() ==
"Windows"):
56 target =
'../build_web/calcpy/calc.pyd'
57 env_dll.Command(target, cpplib, copyLibBuilder )
60 env_test = env.Clone()
62 if(platform.system() ==
"Linux"):
63 env_test.Append( LIBS = [
'python2.7',
'boost_unit_test_framework' ] )
64 env_test.Prepend( LIBS =
'calc' )
65 elif(platform.system() ==
"Windows"):
66 env_test.Prepend( LIBS =
'calc' )
67 env_test.Program( target =
"calc_test", source =
'tests/calc_test.cpp')