diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-11-08 19:50:24 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-11-08 19:50:24 +0100 |
| commit | afa516a3bae3a2dd4bb4a92cb12f3f6fcdcc8e5c (patch) | |
| tree | 8cf468bee3e762a270a256dda2ddc53d410fe861 /rakelib/support/platform.rb | |
| parent | 39db5d5b89dfd2086d73d171487ab9f185a0adf0 (diff) | |
| download | elna-afa516a3bae3a2dd4bb4a92cb12f3f6fcdcc8e5c.tar.gz | |
Fix comparison with an exported constant
Diffstat (limited to 'rakelib/support/platform.rb')
| -rw-r--r-- | rakelib/support/platform.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/rakelib/support/platform.rb b/rakelib/support/platform.rb index 0785b52..a622c7f 100644 --- a/rakelib/support/platform.rb +++ b/rakelib/support/platform.rb @@ -3,6 +3,8 @@ # obtain one at https://mozilla.org/MPL/2.0/. # frozen_string_literal: true +require 'rake' + # Platform and architecture helpers for build includes and targets. module Platform def self.host_os @@ -20,13 +22,23 @@ module Platform end end - def self.includes(platform = host_os, arch = host_arch) + def self.directories(platform = host_os, arch = host_arch) [ "arch/#{platform}/#{arch}", "arch/platform/#{platform}", 'arch/platform/posix', "arch/#{arch}", 'source' - ].select { |dir| Dir.exist?(dir) }.flat_map { |dir| ['-I', dir] } + ].select { |dir| Dir.exist?(dir) } + end + + def self.includes(platform = host_os, arch = host_arch) + directories(platform, arch).flat_map { |dir| ['-I', dir] } + end + + def self.sources(platform = host_os, arch = host_arch) + FileList[*directories(platform, arch).map { |dir| "#{dir}/**/*.elna" }].select do |file| + file == file.downcase + end end end |
