Skip to content

Commit

Permalink
Add python3 support
Browse files Browse the repository at this point in the history
Since cpython 2 has bugs that won't be fixed on Windows, we have to move
to python 3

Change-Id: I02fe6dcee44e90f60dd68c4a94d8f0319a682b7b
Partial-Bug: #1737177
  • Loading branch information
Michal Clapinski committed Apr 17, 2018
1 parent 554e122 commit a0f7b5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
*.pyc
17 changes: 10 additions & 7 deletions schema/SConscript
Expand Up @@ -20,32 +20,35 @@ if env['CC'] == 'gcc':

env['CCFLAGS'].append(env['CPPDEFPREFIX'] + 'RAPIDJSON_NAMESPACE=contrail_rapidjson')

def get_sources(targets):
return [x for x in targets if re.match(r'(.*)\.cc$', x.abspath)]

targets = env.IFMapAutogen('vnc_cfg.xsd')
lib_srcs = filter(lambda x: re.match(r'(.*)\.cc$', x.abspath), targets)
lib_srcs = get_sources(targets)
lib = env.Library('ifmap_vnc', lib_srcs)

targets = env.IFMapAutogen('bgp_schema.xsd')
lib_srcs = filter(lambda x: re.match(r'(.*)\.cc$', x.abspath), targets)
lib_srcs = get_sources(targets)
lib = env.Library('bgp_schema', lib_srcs)

targets = env.TypeAutogen('xmpp_unicast.xsd')
lib_srcs = filter(lambda x: re.match(r'(.*)\.cc$', x.abspath), targets)
lib_srcs = get_sources(targets)
lib = env.Library('xmpp_unicast', lib_srcs)

targets = env.TypeAutogen('xmpp_multicast.xsd')
lib_srcs = filter(lambda x: re.match(r'(.*)\.cc$', x.abspath), targets)
lib_srcs = get_sources(targets)
lib = env.Library('xmpp_multicast', lib_srcs)

targets = env.TypeAutogen('xmpp_mvpn.xsd')
lib_srcs = filter(lambda x: re.match(r'(.*)\.cc$', x.abspath), targets)
lib_srcs = get_sources(targets)
lib = env.Library('xmpp_mvpn', lib_srcs)

targets = env.TypeAutogen('xmpp_enet.xsd')
lib_srcs = filter(lambda x: re.match(r'(.*)\.cc$', x.abspath), targets)
lib_srcs = get_sources(targets)
lib = env.Library('xmpp_enet', lib_srcs)

targets = env.TypeAutogen('services.xsd')
lib_srcs = filter(lambda x: re.match(r'(.*)\.cc$', x.abspath), targets)
lib_srcs = get_sources(targets)
lib = env.Library('services', lib_srcs)

env.SConscript('test/SConscript', exports='BuildEnv', duplicate = 0)
2 changes: 1 addition & 1 deletion schema/test/SConscript
Expand Up @@ -43,7 +43,7 @@ env.Append(CPPPATH = [env['TOP']])

def CCMapTest(env, testname):
targets = env.IFMapAutogen(testname + '.xsd')
cc_files = filter(lambda x: re.match(r'(.*)\.cc$', x.abspath), targets)
cc_files = [x for x in targets if re.match(r'(.*)\.cc$', x.abspath)]
cc_files.append(File(testname + '_test.cc'))
test = env.Program(testname, cc_files)
return test
Expand Down

0 comments on commit a0f7b5a

Please sign in to comment.