Sunxin пре 7 година
родитељ
комит
2720747889
3 измењених фајлова са 35 додато и 0 уклоњено
  1. 13 0
      SConscript
  2. 11 0
      examples/ImportCplusplus/SConscript
  3. 11 0
      examples/ImportModule/SConscript

+ 13 - 0
SConscript

@@ -1,3 +1,4 @@
+import os
 from building import *
 
 # get current directory
@@ -80,4 +81,16 @@ LOCAL_CPPDEFINES = ['JERRY_JS_PARSER', 'JERRY_ENABLE_ERROR_MESSAGES']
 group = DefineGroup('JerryScript', src, depend = ['PKG_USING_JERRYSCRIPT'], CPPPATH = path, 
     LOCAL_CPPDEFINES = LOCAL_CPPDEFINES, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
 
+list = os.listdir(cwd + '/examples')
+
+if GetDepend('PKG_USING_JERRYSCRIPT'):
+
+    for d in list:
+
+        path = os.path.join(cwd, d)
+
+        if os.path.isfile(os.path.join(path, 'SConscript')):
+
+            group = group + SConscript(os.path.join(d, 'SConscript'))
+
 Return('group')

+ 11 - 0
examples/ImportCplusplus/SConscript

@@ -0,0 +1,11 @@
+from building import *
+
+cwd = GetCurrentDir()
+
+src = Glob('*.cpp')
+
+CPPPATH = [cwd]
+
+group = DefineGroup('JerryScript_demo_addCpp', src, depend = ['PKG_USING_JERRYSCRIPT'], CPPPATH = CPPPATH)
+
+Return('group')

+ 11 - 0
examples/ImportModule/SConscript

@@ -0,0 +1,11 @@
+from building import *
+
+cwd = GetCurrentDir()
+
+src = Glob('*.c')
+
+CPPPATH = [cwd]
+
+group = DefineGroup('JerryScript_demo_addModule', src, depend = ['PKG_USING_JERRYSCRIPT'], CPPPATH = CPPPATH)
+
+Return('group')