diff --git a/compiler/compiler.stanza b/compiler/compiler.stanza index ae9f5046..826bd61e 100644 --- a/compiler/compiler.stanza +++ b/compiler/compiler.stanza @@ -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 diff --git a/compiler/proj-field-types.stanza b/compiler/proj-field-types.stanza index c5568592..8ffb0ea9 100644 --- a/compiler/proj-field-types.stanza +++ b/compiler/proj-field-types.stanza @@ -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) @@ -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( diff --git a/compiler/proj-ir.stanza b/compiler/proj-ir.stanza index 0b658870..48999fcd 100644 --- a/compiler/proj-ir.stanza +++ b/compiler/proj-ir.stanza @@ -79,6 +79,7 @@ public defstruct BuildStmt <: ProjStmt : ccflags: Tuple> flags: Tuple optimize: True|False + debug: True|False with: printer => true diff --git a/compiler/proj-reader.stanza b/compiler/proj-reader.stanza index 2c3e50ca..1af11f50 100644 --- a/compiler/proj-reader.stanza +++ b/compiler/proj-reader.stanza @@ -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) @@ -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 ------------------ diff --git a/compiler/proj-stage0.stanza b/compiler/proj-stage0.stanza index 9c755d16..54fa492b 100644 --- a/compiler/proj-stage0.stanza +++ b/compiler/proj-stage0.stanza @@ -81,6 +81,7 @@ public defstruct BuildStmtS0 <: ProjStmt : ccflags: Maybe flags: Maybe optimize: True|False + debug: True|False with: (printer => true) ;Example: @@ -311,7 +312,7 @@ public defn map (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)))