common-dependencies-post.py 636 B

123456789101112131415161718
  1. #
  2. # post:common-dependencies-post.py
  3. # Convenience script to add build flags for Marlin Enabled Features
  4. #
  5. import pioutil
  6. if pioutil.is_pio_build():
  7. env = pioutil.env
  8. projenv = env
  9. Import("projenv") # src_dir environment. Only for post: scripts!
  10. def apply_board_build_flags():
  11. if not 'BOARD_CUSTOM_BUILD_FLAGS' in env['MARLIN_FEATURES']:
  12. return
  13. projenv.Append(CCFLAGS=env['MARLIN_FEATURES']['BOARD_CUSTOM_BUILD_FLAGS'].split())
  14. # We need to add the board build flags in a post script
  15. # so the platform build script doesn't overwrite the custom CCFLAGS
  16. apply_board_build_flags()