-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples_SNocscript.py
82 lines (69 loc) · 2.73 KB
/
examples_SNocscript.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from helper import *
# Environment
Import( 'env' )
def add_dependencies(env):
#AddDependency(env,'libcaf_opencl','github.com/actor-framework/libcaf_opencl')
AddDependency(env,'libcaf_riac','github.com/actor-framework/libcaf_riac')
AddDependency(env,'libcaf_io','github.com/actor-framework/libcaf_io')
AddDependency(env,'libcaf_core','github.com/actor-framework/libcaf_core')
if env['COMPILER'] != 'mingw':
AddPthreads(env)
AddNetwork(env)
def addWithFiles(progName, path, files, cppPaths, c):
initEnv(env, progName+'_libcaf_examples')
enableQtModules(env,c,True)
env['prj_env'].Append( CPPPATH = cppPaths )
add_dependencies(env)
env['scons'].Default(PrefixProgram(env, path, [progName+".cpp"]+files))
def add(progName, path):
addWithFiles(progName, path, [], [], {})
add('announce_1', 'type_system')
add('announce_2', 'type_system')
add('announce_3', 'type_system')
add('announce_4', 'type_system')
add('announce_5', 'type_system')
add('dancing_kirby', 'message_passing')
add('dining_philosophers', 'message_passing')
add('hello_world', '.')
add('aout', '.')
add('calculator', 'message_passing')
add('typed_calculator', 'message_passing')
add('distributed_calculator', 'remote_actors')
add('group_server', 'remote_actors')
add('group_chat', 'remote_actors')
add('simple_broker', 'brokers')
add('simple_http_broker', 'brokers')
# SEARCH FOR PROTOBUF
conf = Configure(env['scons'])
PROTOBUF_FOUND = conf.CheckLibWithHeader('protobuf', 'google/protobuf/message.h', 'cpp')
if not PROTOBUF_FOUND:
print '******\nDid not find libprotobuf.a or protobuf.lib! Will skip `protobuf_broker` altogether!\n******'
env['scons'] = conf.Finish()
# END SEARCH FOR PROTOBUF
env['scons'].Tool('protoc')
if PROTOBUF_FOUND:
proto_files = env['scons'].Protoc(
[],
"remote_actors/pingpong.proto",
PROTOCPROTOPATH=['.'],
PROTOCOUTDIR='.',
PROTOCPYTHONOUTDIR=None
# PROTOCCPPOUTFLAGS = "dllexport_decl=PROTOCONFIG_EXPORT:", too
)
addWithFiles('protobuf_broker', 'brokers', [proto_files[0]], ['remote_actors'], {})
if env.has_key('QT_TOOL'):
c = {}
c['qt4modules'] = c['qt5modules'] = ['QtCore','QtGui','QtWidgets']
c['qt4ui'] = c['qt5ui'] = ['qtsupport/chatwindow.ui']
addWithFiles('qt_group_chat', 'qtsupport', ['chatwidget.cpp'], ['qtsupport'], c)
else:
print "******\nDid not find QT_TOOL! Will skip `qt_group_chat`\n******"
# SEARCH FOR CURL
conf = Configure(env['scons'])
CURL_FOUND = conf.CheckLibWithHeader('curl', 'curl/curl.h', 'cpp')
if not CURL_FOUND:
print '******\nDid not find libcurl.a or curl.lib! Will skip `curl_fuse` altogether!\n******'
env['scons'] = conf.Finish()
# END SEARCH FOR CURL
if CURL_FOUND:
add('curl_fuse', 'curl')