Compare commits

...

18 Commits

Author SHA1 Message Date
Rachel Fae Fox (foxiepaws) bc10f29204 Objective C sources for only macos should only be added to build under OSX
- moved to macos build config
- made jenkinsfile build much faster.
2019-07-22 12:03:39 -04:00
Rachel Fae Fox (foxiepaws) 662d12b79b remove unneeded option being added.
I misread my compile outputs and didn't see that gnu++17 was already specified under an alias
also i used the completely wrong standard name.
2019-07-22 11:57:44 -04:00
Rachel Fae Fox (foxiepaws) 87e3fa887e freebsd-clang fix (see extended)
Under FreeBSD, and possiblily other clang libcxx based platforms, it seems
that you can't just do constexpr std:array ... but instead actually have to
specify more like constexpr std:array<QString,3>.
2019-07-22 11:40:42 -04:00
Rachel Fae Fox (foxiepaws) f3e48ade3c Added -std to freebsd-clang 2019-07-22 10:55:20 -04:00
Rachel Fae Fox (foxiepaws) 3ef8f61c4d Merge branch 'Jenkins' of https://git.foxiepa.ws/foxiepaws/xybrid into portability/clang 2019-07-22 10:37:58 -04:00
Rachel Fae Fox (foxiepaws) 9460490bce freebsd-clang added to qmake project 2019-07-22 10:34:51 -04:00
Rachel Fae Fox (foxiepaws) 69215761d9 Merge branch 'portability/macos' of https://git.foxiepa.ws/foxiepaws/xybrid into portability/clang 2019-07-22 10:30:09 -04:00
Rachel Fae Fox 5e2b0ea970 update to newer qmake removed need 2019-07-22 10:25:54 -04:00
Rachel Fae Fox 0fe9261d1d cd xybrid. 2019-07-22 10:14:45 -04:00
Rachel Fae Fox bd6041d1e2 qmakespec? 2019-07-22 10:14:11 -04:00
Rachel Fae Fox 138600bf36 Checking pwd 2019-07-22 10:07:10 -04:00
Rachel Fae Fox 30cd64d942 its qmake not build 2019-07-22 10:05:02 -04:00
Rachel Fae Fox dfbd976ef1 don't freak out if the makefile isn't there. 2019-07-22 09:50:33 -04:00
Rachel Fae Fox (foxiepaws) 069f2971ce fix jenkinsfile 2019-07-22 09:49:07 -04:00
Rachel Fae Fox (foxiepaws) 55b71f449f Add Jenkinsfile that i hope is good enough 2019-07-22 09:37:05 -04:00
Rachel Fae Fox (foxiepaws) 713d952cef LIBS += framework foundation 2019-07-22 09:21:23 -04:00
Rachel Fae Fox (foxiepaws) a95df29d8f fixing drag/drop 2019-07-22 09:19:46 -04:00
Rachel Fae Fox (foxiepaws) fe0a5e2096 Merge branch 'master' of https://gitlab.com/zetaPRIME/xybrid into portability/clang 2019-07-18 06:21:49 -04:00
6 changed files with 69 additions and 4 deletions

24
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,24 @@
pipeline {
agent any
stages {
stage('Clean Up') {
steps {
sh '''cd xybrid
make clean || true
rm Makefile || true'''
}
}
stage('qmake') {
steps {
sh '''cd xybrid
qmake'''
}
}
stage('Make') {
steps {
sh '''cd xybrid
make -j 17'''
}
}
}
}

View File

@ -101,13 +101,14 @@ namespace {
#pragma GCC diagnostic pop
// for clang on freebsd (and possibly other non-apple llvm sources) it seems we need to specify more.
// wave function list(s)
const constexpr std::array waveFunc = {
const constexpr std::array<double(*)(double,double,double),3> waveFunc = {
&oscSaw,
&oscSine,
&oscPulse,
};
const std::array waveName = {
const std::array<QString,3> waveName = {
qs("saw"),
qs("sine"),
qs("pulse"),

View File

@ -22,9 +22,10 @@ using namespace Xybrid::Editing;
#include <QMenu>
#include <QMessageBox>
#include "util/macos_urlhelper.h"
#include "mainwindow.h"
SampleListModel::SampleListModel(QObject* parent, MainWindow* window) : QAbstractItemModel (parent) {
this->window = window;
root = std::make_shared<DirectoryNode>();
@ -223,6 +224,7 @@ bool SampleListModel::canDropMimeData(const QMimeData *data, Qt::DropAction acti
return data->hasUrls() || data->hasFormat("xybrid-internal/x-sample-entry-move");
}
bool SampleListModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row [[maybe_unused]], int column [[maybe_unused]], const QModelIndex &parent [[maybe_unused]]) {
if (data->hasUrls()) {
if (action == Qt::IgnoreAction) return true; // can accept type
@ -232,7 +234,16 @@ bool SampleListModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
if (!tdn->isDirectory()) tdn = tdn->parent;
QString p = tdn->path();
QList<QUrl> urls = data->urls();
#ifdef Q_OS_MAC
QList<QUrl> localUrls;
foreach (const QUrl &url, urls) {
QUrl localUrl = fromNSUrl(url);
localUrls.append(localUrl);
urls = localUrls;
}
#endif
bool success = false;
for (auto u : urls) {
if (!u.isLocalFile()) continue;

View File

@ -0,0 +1,10 @@
#ifdef __APPLE__
#ifndef MACOS_URLHELPER_H
#define MACOS_URLHELPER_H
#include <QUrl>
QUrl fromNSUrl(const QUrl &url);
#endif // MACOS_URLHELPER_H
#endif

View File

@ -0,0 +1,11 @@
#ifdef __APPLE__
#include "macos_urlhelper.h"
#include <Foundation/Foundation.h>
QUrl fromNSUrl(const QUrl &url) {
NSURL *nsUrl = url.toNSURL();
NSString *path = nsUrl.path;
QString qtString = QString::fromNSString(path);
return QUrl::fromLocalFile(qtString);
}
#endif

View File

@ -37,17 +37,25 @@ HEADERS += $$files(*.h, true) \
FORMS += $$files(*.ui, true)
RESOURCES += res/resources.qrc
unix:!macx {
freebsd-clang {
DEFINES += WITH_BOOST
LIBS += -lboost_math_tr1
}
macx: {
DEFINES += WITH_BOOST
LIBS += -L/usr/local/Cellar/boost/1.70.0/lib/ -lboost_math_tr1
LIBS += -framework OpenGL
LIBS += -framework Foundation
SOURCES += util/macos_urlhelper.mm
HEADERS += util/macos_urlhelper.h
QMAKE_CXXFLAGS += -I/usr/local/Cellar/boost/1.70.0/include/
}
# TODO: make this work.
CONFIG (boost) {
DEFINES += WITH_BOOST