Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/compiler.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defn compute-build-settings (projenv:StandardProjEnv,
;Compute build optimization level
val build-optimization = optimize?(settings) or optimize(s)
;Compute build optimization level
val build-debug = debug?(settings)
val build-debug = debug?(settings) or debug(s)
;Compute assembly
val build-asm = string-or?(original-asm(settings), value?(assembly(s)))
;Compute output
Expand Down
6 changes: 4 additions & 2 deletions compiler/proj-field-types.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ defmethod map-fields (s:BuildStmtS0, mapper:Mapper) :
map-field(mapper, ccfiles(s), MULTIPLE-PATHS)
map-field(mapper, ccflags(s), MULTIPLE-FLAGS)
map-field(mapper, flags(s), MULTIPLE-SYMBOLS)
optimize(s))
optimize(s)
debug(s))
defmethod convert (s:BuildStmtS0, extractor:Extractor) :
BuildStmt(
name(s)
Expand All @@ -175,7 +176,8 @@ defmethod convert (s:BuildStmtS0, extractor:Extractor) :
extract-tuple(extractor, ccfiles(s), MULTIPLE-PATHS)
extract-tuple(extractor, ccflags(s), MULTIPLE-FLAGS)
extract-tuple(extractor, flags(s), MULTIPLE-SYMBOLS)
optimize(s))
optimize(s)
debug(s))

defmethod map-fields (s:SyntaxPackagesDefinedInStmtS0, mapper:Mapper) :
SyntaxPackagesDefinedInStmtS0(
Expand Down
1 change: 1 addition & 0 deletions compiler/proj-ir.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public defstruct BuildStmt <: ProjStmt :
ccflags: Tuple<String|Tuple<String>>
flags: Tuple<Symbol>
optimize: True|False
debug: True|False
with:
printer => true

Expand Down
4 changes: 3 additions & 1 deletion compiler/proj-reader.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ defsyntax stanza-projfile :
entry?(bs, `ccfiles)
entry?(bs, `ccflags)
entry?(bs, `flags)
entry?(bs, `optimize, false))
entry?(bs, `optimize, false)
entry?(bs, `debug, false))

defrule projstmt = (var ?name:#symbol! = ?v:#projvalue!) :
VarStmtS0(closest-info(), name, v)
Expand Down Expand Up @@ -201,6 +202,7 @@ defsyntax stanza-projfile :
defrule build-option! = (ccflags #:! ?v:#projvalue!) : `ccflags => v
defrule build-option! = (flags #:! ?v:#projvalue!) : `flags => v
defrule build-option! = (optimize) : `optimize => true
defrule build-option! = (debug) : `debug => true

;----------------------------------------------------------
;--------------------- Error Productions ------------------
Expand Down
3 changes: 2 additions & 1 deletion compiler/proj-stage0.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public defstruct BuildStmtS0 <: ProjStmt :
ccflags: Maybe<ProjValue>
flags: Maybe<ProjValue>
optimize: True|False
debug: True|False
with: (printer => true)

;Example:
Expand Down Expand Up @@ -311,7 +312,7 @@ public defn map<?T> (f:ProjItem -> ProjItem, x:?T&ProjItem) -> T :
h(dependencies(x)), h(foreign-packages(x)), h(commands(x)))
(x:BuildStmtS0) : BuildStmtS0(info(x), name(x), type(x), h(inputs(x)), h(supported-vm-packages(x)),
h(pkg(x)), h(output(x)), h(assembly(x)), h(external-dependencies(x)),
h(ccfiles(x)), h(ccflags(x)), h(flags(x)), optimize(x))
h(ccfiles(x)), h(ccflags(x)), h(flags(x)), optimize(x), debug(x))
(x:SyntaxPackagesDefinedInStmtS0) : SyntaxPackagesDefinedInStmtS0(info(x), packages(x), h(filename(x)))
(x:VarStmtS0) : VarStmtS0(info(x), name(x), h(value(x)))
(x:ForeignPackageParamsStmtS0) : ForeignPackageParamsStmtS0(info(x), package-manager(x), h(projdir(x)), h(entries(x)))
Expand Down