Top Level Namespace

Defined Under Namespace

Modules: RubyQt6

Constant Summary collapse

IS_MSWIN =
/mswin/ =~ RUBY_PLATFORM
IS_MINGW =
/mingw/ =~ RUBY_PLATFORM
IS_DARWIN =
RbConfig::CONFIG['host_os'].match?(/darwin/)
RUBYQT6_CXX_FLAGS =
ENV["RUBYQT6_CXX_FLAGS"] || "-Os -fno-fast-math"

Instance Method Summary collapse

Instance Method Details

#have_libffiObject



96
97
98
99
100
101
# File 'lib/mkmf-rice.rb', line 96

def have_libffi
  # Check for libffi to support C style callacks.
  libffi_usable = system_libffi_usable?
  $CPPFLAGS += " -DHAVE_LIBFFI" if libffi_usable
  libffi_usable
end

#qmakeObject



5
6
7
8
9
10
11
12
13
# File 'lib/mkmf-rubyqt6.rb', line 5

def qmake
  return @qmake if @qmake

  ["qmake6", "qmake"].each do |qmake|
    `#{qmake} -v`
    return @qmake = qmake if $?.success?
  end
  raise "Could not find qmake"
end

#qt_install_headersObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/mkmf-rubyqt6.rb', line 15

def qt_install_headers
  return @qt_install_headers if @qt_install_headers

  r = ENV["QT_INSTALL_HEADERS"] || ""
  return @qt_install_headers = r unless r == ""

  r = `#{qmake} -query QT_INSTALL_HEADERS`.strip
  return @qt_install_headers = r unless r == ""

  raise "Could not determine QT_INSTALL_HEADERS folder"
end

#system_libffi_usable?Boolean

Returns:

  • (Boolean)


74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/mkmf-rice.rb', line 74

def system_libffi_usable?
  # We need pkg_config or ffi.h
  libffi_ok = pkg_config("libffi") ||
      have_header("ffi.h") ||
      find_header("ffi.h", "/usr/local/include", "/usr/include/ffi",
                  "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi",
                  "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi") ||
      (find_header("ffi.h", `xcrun --sdk macosx --show-sdk-path`.strip + "/usr/include/ffi") rescue false)

  # Ensure we can link to ffi_prep_closure_loc
  libffi_ok &&= have_library("ffi", "ffi_prep_closure_loc", [ "ffi.h" ]) ||
                have_library("libffi", "ffi_prep_closure_loc", [ "ffi.h" ]) ||
                have_library("libffi-8", "ffi_prep_closure_loc", [ "ffi.h" ])

  if RbConfig::CONFIG['host_os'] =~ /mswin/
    have_library('libffi_convenience')
    have_library('shlwapi')
  end

  libffi_ok
end