Module: Gaudi::ArtifactAdapters::Build
- Includes:
- Commandlines, PlatformOperations
- Defined in:
- lib/gaudi/helpers/artifacts.rb
Instance Method Summary collapse
-
#build(filetask, system_config, platform) ⇒ Object
Links an executable or library using a previously constructed command file.
-
#compile(filetask, system_config, platform) ⇒ Object
Compiles a source file from a previously constructed command file.
Methods included from PlatformOperations
#is_assembly?, #is_exe?, #is_header?, #is_library?, #is_source?
Methods included from Commandlines
#assembler, #compiler, #librarian, #linker
Methods included from ToolOperations
#assembler_options, #command_line, #compiler_options, #librarian_options, #linker_options, #prefixed_objects
Instance Method Details
#build(filetask, system_config, platform) ⇒ Object
Links an executable or library using a previously constructed command file
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/gaudi/helpers/artifacts.rb', line 53 def build filetask,system_config,platform cmd_file=command_file(filetask.name,system_config,platform) if File.exists?(cmd_file) config=system_config.platform_config(platform) if cmd_file.end_with?('.library') cmdline = librarian(cmd_file,config) else cmdline = linker(cmd_file,config) end sh(cmdline.join(' ')) else raise GaudiError, "Missing command file for #{filetask.name}" end end |
#compile(filetask, system_config, platform) ⇒ Object
Compiles a source file from a previously constructed command file
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/gaudi/helpers/artifacts.rb', line 37 def compile filetask,system_config,platform cmd_file=command_file(filetask.name,system_config,platform) if File.exists?(cmd_file) mkdir_p(File.dirname(filetask.name),:verbose=>false) config=system_config.platform_config(platform) if is_assembly?(filetask.prerequisites.first) cmdline = assembler(cmd_file,config) else cmdline = compiler(cmd_file,config) end sh(cmdline.join(' ')) else raise GaudiError, "Missing command file for #{filetask.name}" end end |