86
86
# arguments to forward to julia compilation process
87
87
julia_args = []
88
88
enable_trim:: Bool = false
89
+ project:: String = " --project=$(Base. active_project ()) "
89
90
90
91
let i = 1
91
92
while i <= length (ARGS )
@@ -107,6 +108,8 @@ let i = 1
107
108
push! (julia_args, arg) # forwarded arg
108
109
elseif arg == " --experimental"
109
110
push! (julia_args, arg) # forwarded arg
111
+ elseif startswith (arg, " --proj" )
112
+ global project = arg
110
113
else
111
114
if arg[1 ] == ' -' || ! isnothing (file)
112
115
println (" Unexpected argument `$arg `" )
@@ -150,7 +153,7 @@ bc_path = joinpath(tmpdir, "img-bc.a")
150
153
function precompile_env ()
151
154
# Pre-compile the environment
152
155
# (otherwise obscure error messages will occur)
153
- cmd = addenv (` $julia_cmd --project= $(Base . active_project ()) -e "using Pkg; Pkg.precompile()"` )
156
+ cmd = addenv (` $julia_cmd $project -e "using Pkg; Pkg.precompile()"` )
154
157
verbose && println (" Running: $cmd " )
155
158
if ! success (pipeline (cmd; stdout , stderr ))
156
159
println (stderr , " \n Error encountered during pre-compilation of environment." )
@@ -168,7 +171,7 @@ function compile_products(enable_trim::Bool)
168
171
end
169
172
170
173
# Compile the Julia code
171
- cmd = addenv (` $julia_cmd_target --project= $(Base . active_project ()) --output-o $img_path --output-incremental=no $strip_args $julia_args $(joinpath (@__DIR__ ," juliac-buildscript.jl" )) $absfile $output_type $add_ccallables ` , " OPENBLAS_NUM_THREADS" => 1 , " JULIA_NUM_THREADS" => 1 )
174
+ cmd = addenv (` $julia_cmd_target $project --output-o $img_path --output-incremental=no $strip_args $julia_args $(joinpath (@__DIR__ ," juliac-buildscript.jl" )) $absfile $output_type $add_ccallables ` , " OPENBLAS_NUM_THREADS" => 1 , " JULIA_NUM_THREADS" => 1 )
172
175
verbose && println (" Running: $cmd " )
173
176
if ! success (pipeline (cmd; stdout , stderr ))
174
177
println (stderr , " \n Failed to compile $file " )
0 commit comments