summaryrefslogtreecommitdiff
path: root/src/parsersettings.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/parsersettings.cc')
-rw-r--r--src/parsersettings.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/parsersettings.cc b/src/parsersettings.cc
index 63a7713..de1ff98 100644
--- a/src/parsersettings.cc
+++ b/src/parsersettings.cc
@@ -88,7 +88,7 @@ fs::path find_valid_path(const fs::path &sourcepath,
return fs::path();
}
-void parser_init(const std::string &applicationpath)
+void parser_init(const std::string &applicationpath, bool isgui)
{
// Add paths from OPENSCADPATH before adding built-in paths
const char *openscadpaths = getenv("OPENSCADPATH");
@@ -116,8 +116,11 @@ void parser_init(const std::string &applicationpath)
fs::path libdir(applicationpath);
fs::path tmpdir;
#ifdef __APPLE__
- libdir /= "../Resources"; // Libraries can be bundled
- if (!is_directory(libdir / "libraries")) libdir /= "../../..";
+ // Libraries can be bundled on Mac. If not, fall back to development layout
+ if (isgui) {
+ libdir /= "../Resources";
+ if (!is_directory(libdir / "libraries")) libdir /= "../../..";
+ }
#elif !defined(WIN32)
if (is_directory(tmpdir = libdir / "../share/openscad/libraries")) {
librarydir = boosty::stringy(tmpdir);
contact: Jan Huwald // Impressum