Include the code that we need
- `cin` and `cout` require iostream. - `QT_VERSION` requires QtGlobal. - `QSocketNotifier` requires QSocketNotifier. - Unrelated to includes: let Qt figure out the spec. Found by Jeremy Evans on behalf of the OpenBSD project.
This commit is contained in:
parent
079e6cbca1
commit
0506f24a0a
|
@ -16,32 +16,17 @@ module CapybaraWebkitBuilder
|
||||||
ENV['QMAKE'] || default_qmake_binary
|
ENV['QMAKE'] || default_qmake_binary
|
||||||
end
|
end
|
||||||
|
|
||||||
def spec
|
|
||||||
ENV['SPEC'] || os_spec
|
|
||||||
end
|
|
||||||
|
|
||||||
def default_qmake_binary
|
def default_qmake_binary
|
||||||
case RbConfig::CONFIG['host_os']
|
case RbConfig::CONFIG['host_os']
|
||||||
when /freebsd/
|
when /freebsd/
|
||||||
"qmake-qt4"
|
"qmake-qt4"
|
||||||
|
when /openbsd/
|
||||||
|
"qmake-qt5"
|
||||||
else
|
else
|
||||||
"qmake"
|
"qmake"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def os_spec
|
|
||||||
case RbConfig::CONFIG['host_os']
|
|
||||||
when /linux/
|
|
||||||
"linux-g++"
|
|
||||||
when /freebsd/
|
|
||||||
"freebsd-g++"
|
|
||||||
when /mingw32/
|
|
||||||
"win32-g++"
|
|
||||||
else
|
|
||||||
"macx-g++"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def sh(command)
|
def sh(command)
|
||||||
system(command)
|
system(command)
|
||||||
success = $?.exitstatus == SUCCESS_STATUS
|
success = $?.exitstatus == SUCCESS_STATUS
|
||||||
|
@ -56,7 +41,7 @@ module CapybaraWebkitBuilder
|
||||||
def makefile(*configs)
|
def makefile(*configs)
|
||||||
configs += default_configs
|
configs += default_configs
|
||||||
configs = configs.map { |config| config.shellescape}.join(" ")
|
configs = configs.map { |config| config.shellescape}.join(" ")
|
||||||
sh("#{qmake_bin} -spec #{spec} #{configs}")
|
sh("#{qmake_bin} #{configs}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def qmake
|
def qmake
|
||||||
|
|
|
@ -16,12 +16,6 @@ describe CapybaraWebkitBuilder do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "will use the env variable for #os_spec" do
|
|
||||||
with_env_vars("SPEC" => "fake_os_spec") do
|
|
||||||
builder.spec.should == "fake_os_spec"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
it "defaults the #make_bin" do
|
it "defaults the #make_bin" do
|
||||||
with_env_vars("MAKE_BIN" => nil) do
|
with_env_vars("MAKE_BIN" => nil) do
|
||||||
builder.make_bin.should == 'make'
|
builder.make_bin.should == 'make'
|
||||||
|
@ -33,11 +27,5 @@ describe CapybaraWebkitBuilder do
|
||||||
builder.qmake_bin.should == 'qmake'
|
builder.qmake_bin.should == 'qmake'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "defaults #spec to the #os_specs" do
|
|
||||||
with_env_vars("SPEC" => nil) do
|
|
||||||
builder.spec.should == builder.os_spec
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include "StdinNotifier.h"
|
#include "StdinNotifier.h"
|
||||||
|
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
|
#include <QSocketNotifier>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
StdinNotifier::StdinNotifier(QObject *parent) : QObject(parent) {
|
StdinNotifier::StdinNotifier(QObject *parent) : QObject(parent) {
|
||||||
m_notifier = new QSocketNotifier(fileno(stdin), QSocketNotifier::Read, this);
|
m_notifier = new QSocketNotifier(fileno(stdin), QSocketNotifier::Read, this);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#ifndef _WEBPAGE_H
|
#ifndef _WEBPAGE_H
|
||||||
#define _WEBPAGE_H
|
#define _WEBPAGE_H
|
||||||
|
#include <QtGlobal>
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
#include <QtWebKitWidgets>
|
#include <QtWebKitWidgets>
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue