Sha256: ab8872e580a3f9e4aa01815416de3aeb11d30dd4969a7cf2b499889688a91189

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

require 'pkg-config'
require 'xezat'

module Xezat
  module Command
    class Validate
      def validate_config(variables, gcc_version)
        configs = Dir.glob(File.join(variables[:D], '/usr/bin/*-config'))
        configs.each do |config|
          basename = File.basename(config)
          Xezat.logger.debug("    #{basename} found")

          result, _, status = Open3.capture3("#{config} --cflags")
          if status.success?
            Xezat.logger.debug("      cflags = #{result.strip}")
          else
            Xezat.logger.warn('       cflags not supported')
          end

          result, _, status = Open3.capture3("#{config} --cxxflags")
          if status.success?
            Xezat.logger.debug("      cxxflags = #{result.strip}")
          else
            Xezat.logger.warn('       cxxflags not supported')
          end

          result, _, status = Open3.capture3("#{config} --libs")
          if status.success?
            Xezat.logger.debug("      libs = #{result.strip}")
            validate_libs(variables, result.strip, gcc_version)
          else
            Xezat.logger.warn('       libs not supported')
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xezat-0.3.0 lib/xezat/command/validate/config.rb
xezat-0.2.3 lib/xezat/command/validate/config.rb