craftr-build / craftr-build-4.x

Frontend for the Craftr build framework.
https://craftr-build.github.io/craftr/
Other
60 stars 14 forks source link

Add support for CFLAGS, CPPFLAGS, LDFLAGS, etc. in Craftr 2.x #152

Closed NiklasRosenstein closed 7 years ago

NiklasRosenstein commented 7 years ago

This feature is currently disabled in Craftr 2.x because there is currently no option to specify buildtype=external as it was possible in Craftr 1.

SadE54 commented 7 years ago

yeah seriously needed :)

SadE54 commented 7 years ago

I saw in the commit : "flags = shell.split(os.getenv('LDFLAGS', '').strip())" So we can only give linker flags by os vars ?

NiklasRosenstein commented 7 years ago

Currently, yes. Do you think that is too limiting? I could add options that can be specified like

craftr export -d "ldflags=<flags here>"
SadE54 commented 7 years ago

Yeah please, for compiler used for embedded you always hava a lot of options for the linker , like the scatter file , ... Thanks !

2017-01-15 6:59 GMT+01:00 Niklas Rosenstein notifications@github.com:

Currently, yes. Do you think that is too limiting? I could add options that can be specified like -d "ldflags="

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/craftr-build/craftr/issues/152#issuecomment-272675854, or mute the thread https://github.com/notifications/unsubscribe-auth/ACvtML_e4O8CRkq92te6gVVajXlgRDJHks5rSbXHgaJpZM4LDwfN .

NiklasRosenstein commented 7 years ago

Ok, I'll add that. Just in case you didn;t know, you can also specify additional linker flags in the Craftrfile.

cxx = load('craftr.lang.cxx')
main = cxx.executable(  # recently renamed from binary(), backwards compatible name still available
  output = 'main',
  input = ... ,
  additional_flags = ['cross', 'platform', 'linker', 'flags'],
  llvm_additional_flags = ['flags', 'only', 'for', 'llvm'],
  gcc_additional_flags = ['flags', 'only', 'for', 'gcc'],
  msvc_additional_flags = ['flags', 'only', 'for', 'msvc']
)