restricted c header imports
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package compiler
|
||||
|
||||
import "./backend"
|
||||
import "./cimport"
|
||||
import "./checker"
|
||||
import "./llvm"
|
||||
import "./linker"
|
||||
@@ -19,6 +20,7 @@ compile_package :: proc(
|
||||
input_path, output_path: string,
|
||||
link_arguments: []linker.Argument = nil,
|
||||
selected := target.DEFAULT,
|
||||
c_options := cimport.Options{},
|
||||
) -> int {
|
||||
sources := source.init_store()
|
||||
defer source.destroy_store(&sources)
|
||||
@@ -59,6 +61,8 @@ compile_package :: proc(
|
||||
&symbols,
|
||||
vmem.arena_allocator(&lexer_arena),
|
||||
vmem.arena_allocator(&parser_arena),
|
||||
c_options,
|
||||
selected,
|
||||
)
|
||||
if !loaded {
|
||||
source.print_all(&diagnostics)
|
||||
@@ -83,7 +87,7 @@ compile_package :: proc(
|
||||
}
|
||||
|
||||
source.print_all(&diagnostics)
|
||||
if !backend.compile(llvm_path, output_path, link_arguments, selected) {
|
||||
if !backend.compile(llvm_path, output_path, link_arguments, selected, c_options) {
|
||||
return 2
|
||||
}
|
||||
if len(diagnostics.items) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user