mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-06-25 15:29:34 +00:00
cc65: can #define CC65_FLAGS <comma-separated values>
This commit is contained in:
parent
ab090455db
commit
a0ec21d623
|
@ -1253,6 +1253,9 @@ function fixParamsWithDefines(path:string, params){
|
||||||
} else if (ident == 'LIBARGS' && value) {
|
} else if (ident == 'LIBARGS' && value) {
|
||||||
params.libargs = value.split(',').filter((s) => { return s!=''; });
|
params.libargs = value.split(',').filter((s) => { return s!=''; });
|
||||||
console.log('Using libargs', params.libargs);
|
console.log('Using libargs', params.libargs);
|
||||||
|
} else if (ident == 'CC65_FLAGS' && value) {
|
||||||
|
params.extra_compiler_args = value.split(',').filter((s) => { return s!=''; });
|
||||||
|
console.log('Using compiler flags', params.extra_compiler_args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1292,9 +1295,7 @@ function compileCC65(step:BuildStep) {
|
||||||
setupFS(FS, '65-'+getRootBasePlatform(step.platform));
|
setupFS(FS, '65-'+getRootBasePlatform(step.platform));
|
||||||
populateFiles(step, FS);
|
populateFiles(step, FS);
|
||||||
fixParamsWithDefines(step.path, params);
|
fixParamsWithDefines(step.path, params);
|
||||||
var args = ['-T', '-g',
|
var args = [
|
||||||
'-Oirs', // don't inline CodeSizeFactor 200? (no -Oi)
|
|
||||||
'-Cl', // static locals
|
|
||||||
'-I', '/share/include',
|
'-I', '/share/include',
|
||||||
'-I', '.',
|
'-I', '.',
|
||||||
"-D", "__8BITWORKSHOP__",
|
"-D", "__8BITWORKSHOP__",
|
||||||
|
@ -1305,6 +1306,8 @@ function compileCC65(step:BuildStep) {
|
||||||
if (step.mainfile) {
|
if (step.mainfile) {
|
||||||
args.unshift.apply(args, ["-D", "__MAIN__"]);
|
args.unshift.apply(args, ["-D", "__MAIN__"]);
|
||||||
}
|
}
|
||||||
|
var customArgs = params.extra_compiler_args || ['-T', '-g', '-Oirs', '-Cl'];
|
||||||
|
args = args.concat(customArgs, args);
|
||||||
args.push(step.path);
|
args.push(step.path);
|
||||||
//console.log(args);
|
//console.log(args);
|
||||||
execMain(step, CC65, args);
|
execMain(step, CC65, args);
|
||||||
|
|
|
@ -260,5 +260,8 @@ describe('Worker', function() {
|
||||||
};
|
};
|
||||||
doBuild(msgs, done2, 205, 0, 0);
|
doBuild(msgs, done2, 205, 0, 0);
|
||||||
});
|
});
|
||||||
|
it('should compile CC65 flags', function(done) {
|
||||||
|
compile('cc65', '#define CC65_FLAGS -O1,-j\nint main() {\nint x=1;\nreturn x+2;\n}', 'apple2', done, 14697, 5);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user