@@ -33,6 +33,11 @@ function main(args)
3333 " --clean" , " -c"
3434 action = :store_true
3535 help = " delete builddir"
36+ " --sysimage" , " -J"
37+ arg_type = String
38+ default = nothing
39+ metavar = " <file>"
40+ help = " start up with the given system image file"
3641 " --cpu-target" , " -C"
3742 arg_type = String
3843 default = nothing
@@ -111,6 +116,7 @@ function main(args)
111116 parsed_args[" verbose" ],
112117 parsed_args[" quiet" ],
113118 parsed_args[" clean" ],
119+ parsed_args[" sysimage" ],
114120 parsed_args[" cpu-target" ],
115121 parsed_args[" optimize" ],
116122 parsed_args[" debug" ],
@@ -125,8 +131,9 @@ function main(args)
125131 )
126132end
127133
128- function julia_compile (julia_program, c_program= nothing , build_dir= " builddir" , verbose= false , quiet= false , clean= false ,
129- cpu_target= nothing , optimize= nothing , debug= nothing , inline= nothing , check_bounds= nothing , math_mode= nothing , depwarn= nothing ,
134+ function julia_compile (julia_program, c_program= nothing , build_dir= " builddir" , verbose= false , quiet= false ,
135+ clean= false , sysimage = nothing , cpu_target= nothing , optimize= nothing , debug= nothing ,
136+ inline= nothing , check_bounds= nothing , math_mode= nothing , depwarn= nothing ,
130137 object= false , shared= false , executable= true , julialibs= true )
131138
132139 verbose && quiet && (verbose = false )
@@ -182,6 +189,7 @@ function julia_compile(julia_program, c_program=nothing, build_dir="builddir", v
182189 if length (julia_cmd. exec) != 5 || ! all (startswith .(julia_cmd. exec[2 : 5 ], [" -C" , " -J" , " --compile" , " --depwarn" ]))
183190 error (" Unexpected format of \" Base.julia_cmd()\" , you may be using an incompatible version of Julia" )
184191 end
192+ sysimage == nothing || (julia_cmd. exec[3 ] = " -J$sysimage " )
185193 push! (julia_cmd. exec, " --startup-file=no" )
186194 cpu_target == nothing || (julia_cmd. exec[2 ] = " -C$cpu_target " )
187195 optimize == nothing || push! (julia_cmd. exec, " -O$optimize " )
@@ -198,7 +206,7 @@ function julia_compile(julia_program, c_program=nothing, build_dir="builddir", v
198206 include($(repr (julia_program)) ) # include \" julia_program\" file
199207 empty!(Base.LOAD_CACHE_PATH) # reset / remove build-system-relative paths"
200208 command = ` $julia_cmd -e $expr `
201- verbose && println (" Populate \" .ji\" local cache:\n $command " )
209+ verbose && println (" Build \" .ji\" files local cache:\n $command " )
202210 run (command)
203211 command = ` $julia_cmd --output-o $o_file -e $expr `
204212 verbose && println (" Build object file \" $o_file \" :\n $command " )
0 commit comments