Skip to content

Commit b3a6945

Browse files
committed
Allow passing flags to cc compiler for linking
1 parent 932f3bd commit b3a6945

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/JuliaC.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Base.@kwdef mutable struct LinkRecipe
3434
image_recipe::ImageRecipe = ImageRecipe()
3535
outname::String = ""
3636
rpath::Union{String, Nothing} = nothing
37+
cc_flags::Vector{String} = String[]
3738
end
3839

3940
Base.@kwdef mutable struct BundleRecipe

src/linking.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ function link_products(recipe::LinkRecipe)
103103
mkpath(dirname(recipe.outname))
104104
is_shared_output = image_recipe.output_type != "--output-exe"
105105
# Base command
106-
cmd2 = `$(compiler_cmd) $(allflags) $(rpath_str) -o $(recipe.outname)`
106+
cmd2 = `$(compiler_cmd)`
107+
for f in recipe.cc_flags
108+
cmd2 = `$cmd2 $f`
109+
end
110+
cmd2 = `$cmd2 $(allflags) $(rpath_str) -o $(recipe.outname)`
107111
if is_shared_output
108112
cmd2 = `$cmd2 -shared`
109113
end

0 commit comments

Comments
 (0)