-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WiP] Build on OSX (#3) #25
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "vst3sdk"] | ||
path = vst3sdk | ||
url = https://github.com/steinbergmedia/vst3sdk.git | ||
url = https://github.com/steinbergmedia/vst3sdk.git | ||
[submodule "VST_SDK_2.4"] | ||
path = VST_SDK_2.4 | ||
url = https://github.com/R-Tur/VST_SDK_2.4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
// | ||
// filesystem.cpp | ||
// surge-vst2 | ||
// | ||
// Created by Keith Zantow on 10/2/18. | ||
// | ||
|
||
#ifdef __APPLE__ | ||
#include "TargetConditionals.h" | ||
#ifdef TARGET_OS_MAC | ||
|
||
#include "filesystem.h" | ||
|
||
namespace std::experimental::filesystem { | ||
path::path(): | ||
path("") | ||
{} | ||
|
||
path::path(std::string filePath): | ||
p(filePath) | ||
{} | ||
|
||
path::operator std::string() { | ||
return p; | ||
} | ||
|
||
void path::append(std::string s) { | ||
p.append("/"); | ||
p.append(s); | ||
} | ||
|
||
const char* path::c_str() { | ||
return p.c_str(); | ||
} | ||
|
||
std::string path::generic_string() { | ||
return p; | ||
} | ||
|
||
path path::filename() { | ||
auto idx = this->p.find_last_of("/"); | ||
path p(this->p.substr(idx+1)); | ||
return p; | ||
} | ||
|
||
std::string path::extension() { | ||
auto idx = this->p.find_last_of("."); | ||
return p.substr(idx); | ||
} | ||
|
||
file::file(std::string filePath): | ||
p(filePath) | ||
{} | ||
|
||
file::operator class path() { | ||
return p; | ||
} | ||
|
||
path file::path() { | ||
return p; | ||
} | ||
|
||
bool exists(path p) { | ||
FILE *file; | ||
if ((file = fopen(p.p.c_str(), "r"))) | ||
{ | ||
fclose(file); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
void create_directories(path p) { | ||
mode_t nMode = 0733; // UNIX style permissions | ||
int nError = 0; | ||
#if defined(_WIN32) | ||
nError = _mkdir(p.c_str()); // can be used on Windows | ||
#else | ||
nError = mkdir(p.c_str(), nMode); // can be used on non-Windows | ||
#endif | ||
if (nError != 0) { | ||
// handle your error here | ||
} | ||
} | ||
|
||
bool is_directory(path p) { | ||
DIR *dp; | ||
bool isDir = false; | ||
if((dp = opendir(p.c_str())) != NULL && readdir(dp) != NULL) { | ||
isDir = true; | ||
} | ||
closedir(dp); | ||
return isDir; | ||
} | ||
|
||
std::vector<file> directory_iterator(path p) { | ||
std::vector<file> files; | ||
DIR *dp; | ||
struct dirent *dirp; | ||
if((dp = opendir(p.c_str())) == NULL) { | ||
// std::cout << "Error(" << errno << ") opening " << p.generic_string() << std::endl; | ||
} | ||
|
||
while ((dirp = readdir(dp)) != NULL) { | ||
files.push_back(file(string(dirp->d_name))); | ||
} | ||
closedir(dp); | ||
|
||
return files; | ||
} | ||
} | ||
|
||
#endif | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// | ||
// Filesystem.h | ||
// surge-vst2 | ||
// | ||
// Created by Keith Zantow on 10/2/18. | ||
// | ||
|
||
#ifndef Filesystem_h | ||
#define Filesystem_h | ||
|
||
#ifdef __APPLE__ | ||
#include "TargetConditionals.h" | ||
#ifdef TARGET_OS_MAC | ||
|
||
#include <string> | ||
#include <vector> | ||
#include <sys/types.h> | ||
#include <sys/stat.h> | ||
#include <dirent.h> | ||
|
||
namespace std::experimental::filesystem { | ||
class path { | ||
public: | ||
std::string p; | ||
|
||
path(); | ||
|
||
path(std::string filePath); | ||
|
||
operator std::string(); | ||
|
||
void append(std::string s); | ||
|
||
const char* c_str(); | ||
|
||
std::string generic_string(); | ||
|
||
path filename(); | ||
|
||
std::string extension(); | ||
}; | ||
|
||
class file { | ||
public: | ||
path p; | ||
|
||
file(std::string filePath); | ||
|
||
operator path(); | ||
|
||
path path(); | ||
}; | ||
|
||
bool exists(path p); | ||
|
||
void create_directories(path p); | ||
|
||
bool is_directory(path p); | ||
|
||
std::vector<file> directory_iterator(path p); | ||
} | ||
|
||
#endif | ||
#else | ||
#include <filesystem> | ||
#endif | ||
|
||
#endif /* Filesystem_h */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,7 @@ function plugincommon() | |
"libs/xml/tinyxml.cpp", | ||
"libs/xml/tinyxmlerror.cpp", | ||
"libs/xml/tinyxmlparser.cpp", | ||
"libs/filesystem/filesystem.cpp", | ||
"src/common/vt_dsp/*.cpp", | ||
"src/common/thread/*.cpp", | ||
"vst3sdk/pluginterfaces/base/*.cpp", | ||
|
@@ -162,6 +163,12 @@ function plugincommon() | |
"-Wno-unused-variable" | ||
} | ||
|
||
sysincludedirs { | ||
"src/**", | ||
"libs/**", | ||
"vst3sdk/vstgui4", | ||
} | ||
|
||
files | ||
{ | ||
"src/mac/**.mm", | ||
|
@@ -293,6 +300,7 @@ plugincommon() | |
files { | ||
"src/vst2/**.cpp", | ||
"src/vst2/**.h", | ||
"VST_SDK_2.4/public.sdk/source/vst2.x/**.cpp", | ||
"vst3sdk/public.sdk/source/vst2.x/**.cpp", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this does not actually include anything to solve VST 2 compilation, does it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kzantow how does one incorporate vstsdk2.4 and vst3sdk into the mix, they don't seem to be a part of this repo. do they require a secondary install? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not perfect. unclear licensing etc. it seems that Steinb0rg has completely dropped support for VST 2, which I have no idea how the license plays out in that case. but i found some stuff to make it work, barring being taken down There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I was able to find a VST2.4SDK from somewhere and am linking to it outside the repo, for now, hoping to get a Surge.vst to compile and be able to do a |
||
VSTGUI .. "plugin-bindings/aeffguieditor.cpp", | ||
} | ||
|
@@ -303,6 +311,7 @@ excludes { | |
|
||
includedirs { | ||
"src/vst2", | ||
"VST_SDK_2.4", | ||
"vst3sdk" | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ using namespace std; | |
|
||
#if __linux | ||
#include <experimental/filesystem> | ||
#elif __APPLE__ | ||
#include <filesystem.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It tries to include the filesystem from c++17 or 14 right? |
||
#else | ||
#include <filesystem> | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obviously not necessary...