Skip to content

Commit

Permalink
AVR: declare CPU as compiler flag
Browse files Browse the repository at this point in the history
This allows to know actual support for some features, for example which
pins are available.
  • Loading branch information
ysbaddaden committed Apr 6, 2024
1 parent b0f0c5d commit d2cfa7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/compiler/crystal/semantic/flags.cr
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class Crystal::Program

flags.add "bsd" if target.bsd?

if target.avr? && (cpu = target_machine.cpu.presence)
flags.add cpu
end

flags
end
end

0 comments on commit d2cfa7b

Please sign in to comment.