@@ -33,6 +33,48 @@ function main(args)
3333 " --clean" , " -c"
3434 action = :store_true
3535 help = " delete builddir"
36+ " --cpu-target" , " -C"
37+ arg_type = String
38+ default = nothing
39+ metavar = " <target>"
40+ help = " limit usage of CPU features up to <target>"
41+ " --optimize" , " -O"
42+ arg_type = Int
43+ default = nothing
44+ range_tester = (x -> 0 <= x <= 3 )
45+ metavar = " {0,1,2,3}"
46+ help = " set optimization level"
47+ " -g"
48+ arg_type = Int
49+ default = nothing
50+ range_tester = (x -> 0 <= x <= 2 )
51+ dest_name = " debug"
52+ metavar = " {0,1,2}"
53+ help = " set debugging information level"
54+ " --inline"
55+ arg_type = String
56+ default = nothing
57+ range_tester = (x -> x == " yes" || x == " no" )
58+ metavar = " {yes|no}"
59+ help = " control whether inlining is permitted"
60+ " --check-bounds"
61+ arg_type = String
62+ default = nothing
63+ range_tester = (x -> x == " yes" || x == " no" )
64+ metavar = " {yes|no}"
65+ help = " emit bounds checks always or never"
66+ " --math-mode"
67+ arg_type = String
68+ default = nothing
69+ range_tester = (x -> x == " ieee" || x == " fast" )
70+ metavar = " {ieee,fast}"
71+ help = " set floating point optimizations"
72+ " --depwarn"
73+ arg_type = String
74+ default = nothing
75+ range_tester = (x -> x == " yes" || x == " no" || x == " error" )
76+ metavar = " {yes|no|error}"
77+ help = " set syntax and method deprecation warnings"
3678 " --object" , " -o"
3779 action = :store_true
3880 help = " build object file"
@@ -69,15 +111,23 @@ function main(args)
69111 parsed_args[" verbose" ],
70112 parsed_args[" quiet" ],
71113 parsed_args[" clean" ],
114+ parsed_args[" cpu-target" ],
115+ parsed_args[" optimize" ],
116+ parsed_args[" debug" ],
117+ parsed_args[" inline" ],
118+ parsed_args[" check-bounds" ],
119+ parsed_args[" math-mode" ],
120+ parsed_args[" depwarn" ],
72121 parsed_args[" object" ],
73122 parsed_args[" shared" ],
74123 parsed_args[" executable" ],
75124 parsed_args[" julialibs" ]
76125 )
77126end
78127
79- function julia_compile (julia_program, c_program= nothing , build_dir= " builddir" , verbose= false , quiet= false ,
80- clean= false , object= false , shared= false , executable= true , julialibs= true )
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 ,
130+ object= false , shared= false , executable= true , julialibs= true )
81131
82132 verbose && quiet && (verbose = false )
83133
@@ -127,6 +177,13 @@ function julia_compile(julia_program, c_program=nothing, build_dir="builddir", v
127177 delete_object = false
128178 if object || shared || executable
129179 julia_cmd = ` $(Base. julia_cmd ()) --startup-file=no`
180+ cpu_target == nothing || splice! (julia_cmd. exec, 2 , [" -C$cpu_target " ])
181+ optimize == nothing || push! (julia_cmd. exec, " -O$optimize " )
182+ debug == nothing || push! (julia_cmd. exec, " -g$debug " )
183+ inline == nothing || push! (julia_cmd. exec, " --inline=$inline " )
184+ check_bounds == nothing || push! (julia_cmd. exec, " --check-bounds=$check_bounds " )
185+ math_mode == nothing || push! (julia_cmd. exec, " --math-mode=$math_mode " )
186+ depwarn == nothing || splice! (julia_cmd. exec, 5 , [" --depwarn=$depwarn " ])
130187 is_windows () && (julia_program = replace (julia_program, " \\ " , " \\\\ " ))
131188 expr = "
132189 VERSION >= v\" 0.7+\" && Base.init_load_path($(repr (JULIA_HOME)) ) # initialize location of site-packages
0 commit comments