|
23 | 23 | from settings import *
|
24 | 24 |
|
25 | 25 | BUILD_DIR = path.join(PROJECT_DIR, 'build')
|
| 26 | +DEFAULT_PORT_DIR = path.join(PROJECT_DIR, 'targets/default') |
26 | 27 |
|
27 | 28 | def default_toolchain():
|
28 | 29 | (sysname, _, _, _, machine) = uname()
|
@@ -58,6 +59,7 @@ def devhelp(help):
|
58 | 59 | parser.add_argument('--link-lib', metavar='OPT', action='append', default=[], help='add custom library to be linked')
|
59 | 60 | parser.add_argument('--linker-flag', metavar='OPT', action='append', default=[], help='add custom linker flag')
|
60 | 61 | parser.add_argument('--lto', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper, help='enable link-time optimizations (%(choices)s; default: %(default)s)')
|
| 62 | + parser.add_argument('--port-dir', metavar='DIR', action='store', default=DEFAULT_PORT_DIR, help='add port directory (default: %(default)s)') |
61 | 63 | parser.add_argument('--profile', metavar='PROFILE', choices=['es5.1', 'minimal', 'es2015-subset'], default='es5.1', type=str.lower, help='specify the profile (%(choices)s; default: %(default)s)')
|
62 | 64 | parser.add_argument('--snapshot-exec', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper, help='enable executing snapshot files (%(choices)s; default: %(default)s)')
|
63 | 65 | parser.add_argument('--snapshot-save', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper, help='enable saving snapshot files (%(choices)s; default: %(default)s)')
|
@@ -100,6 +102,7 @@ def generate_build_options(arguments):
|
100 | 102 | build_options.append('-DEXTERNAL_LINK_LIBS=' + ' '.join(arguments.link_lib))
|
101 | 103 | build_options.append('-DEXTERNAL_LINKER_FLAGS=' + ' '.join(arguments.linker_flag))
|
102 | 104 | build_options.append('-DENABLE_LTO=%s' % arguments.lto)
|
| 105 | + build_options.append('-DPORT_DIR=%s' % arguments.port_dir) |
103 | 106 | build_options.append('-DFEATURE_PROFILE=%s' % arguments.profile)
|
104 | 107 | build_options.append('-DFEATURE_SNAPSHOT_EXEC=%s' % arguments.snapshot_exec)
|
105 | 108 | build_options.append('-DFEATURE_SNAPSHOT_SAVE=%s' % arguments.snapshot_save)
|
|
0 commit comments