platform.lua 487 B

1234567891011121314151617181920212223242526272829
  1. local platform_info = require 'platform_info'
  2. local util = require 'gluon.util'
  3. local setmetatable = setmetatable
  4. module 'gluon.platform'
  5. setmetatable(_M,
  6. {
  7. __index = platform_info,
  8. }
  9. )
  10. function match(target, subtarget, boards)
  11. if get_target() ~= target then
  12. return false
  13. end
  14. if get_subtarget() ~= subtarget then
  15. return false
  16. end
  17. if boards and not util.contains(boards, get_board_name()) then
  18. return false
  19. end
  20. return true
  21. end