8686# arguments to forward to julia compilation process
8787julia_args = []
8888enable_trim:: Bool = false
89+ project:: String = " --project=$(Base. active_project ()) "
8990
9091let i = 1
9192 while i <= length (ARGS )
@@ -107,6 +108,8 @@ let i = 1
107108 push! (julia_args, arg) # forwarded arg
108109 elseif arg == " --experimental"
109110 push! (julia_args, arg) # forwarded arg
111+ elseif startswith (arg, " --proj" )
112+ global project = arg
110113 else
111114 if arg[1 ] == ' -' || ! isnothing (file)
112115 println (" Unexpected argument `$arg `" )
@@ -150,7 +153,7 @@ bc_path = joinpath(tmpdir, "img-bc.a")
150153function precompile_env ()
151154 # Pre-compile the environment
152155 # (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()"` )
154157 verbose && println (" Running: $cmd " )
155158 if ! success (pipeline (cmd; stdout , stderr ))
156159 println (stderr , " \n Error encountered during pre-compilation of environment." )
@@ -168,7 +171,7 @@ function compile_products(enable_trim::Bool)
168171 end
169172
170173 # 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 )
172175 verbose && println (" Running: $cmd " )
173176 if ! success (pipeline (cmd; stdout , stderr ))
174177 println (stderr , " \n Failed to compile $file " )
0 commit comments