mirror of https://github.com/vitalif/openscad
Merge branch 'master' of github.com:openscad/openscad
commit
de2e1090ca
|
@ -58,21 +58,21 @@ fi
|
|||
|
||||
echo "entering" $MXEDIR
|
||||
cd $MXEDIR
|
||||
echo 'checkout stable branch'
|
||||
git checkout stable
|
||||
echo 'checkout master branch'
|
||||
git checkout master
|
||||
if [ "`echo $* | grep 64`" ]; then
|
||||
MXE_TARGETS='x86_64-w64-mingw32'
|
||||
MXE_TARGETS='x86_64-w64-mingw32.static'
|
||||
if [ "`echo $* | grep download`" ]; then
|
||||
PACKAGES='download-mpfr download-eigen download-opencsg download-cgal download-qt download-qt5 download-glib download-freetype download-fontconfig download-harfbuzz'
|
||||
PACKAGES='download-mpfr download-eigen download-opencsg download-cgal download-qtbase download-glib download-freetype download-fontconfig download-harfbuzz'
|
||||
else
|
||||
PACKAGES='qt qt5 mpfr eigen opencsg cgal glib freetype fontconfig harfbuzz'
|
||||
PACKAGES='qtbase mpfr eigen opencsg cgal glib freetype fontconfig harfbuzz'
|
||||
fi
|
||||
else
|
||||
MXE_TARGETS='i686-pc-mingw32'
|
||||
MXE_TARGETS='i686-w64-mingw32.static'
|
||||
if [ "`echo $* | grep download`" ]; then
|
||||
PACKAGES='download-mpfr download-eigen download-opencsg download-cgal download-qt download-qt5 download-nsis download-glib download-freetype download-fontconfig download-harfbuzz'
|
||||
PACKAGES='download-mpfr download-eigen download-opencsg download-cgal download-qtbase download-nsis download-glib download-freetype download-fontconfig download-harfbuzz'
|
||||
else
|
||||
PACKAGES='qt qt5 mpfr eigen opencsg cgal nsis glib freetype fontconfig harfbuzz'
|
||||
PACKAGES='qtbase mpfr eigen opencsg cgal nsis glib freetype fontconfig harfbuzz'
|
||||
fi
|
||||
fi
|
||||
echo make $PACKAGES MXE_TARGETS=$MXE_TARGETS -j $NUMCPU JOBS=$NUMJOBS
|
||||
|
|
|
@ -361,6 +361,9 @@ if [ -n $FONTDIR ]; then
|
|||
MACOSX)
|
||||
cp -a fonts-osx/* $FONTDIR
|
||||
;;
|
||||
UNIX_CROSS_WIN)
|
||||
cp -a "$DEPLOYDIR"/mingw-cross-env/etc/fonts/. "$FONTDIR"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ -n $LIBRARYDIR ]; then
|
||||
|
|
|
@ -56,9 +56,9 @@ if [ ! -e $DEPLOYDIR ]; then
|
|||
fi
|
||||
|
||||
if [ "`echo $* | grep 64 `" ]; then
|
||||
MXETARGETDIR=$MXEDIR/usr/x86_64-w64-mingw32
|
||||
MXETARGETDIR=$MXEDIR/usr/x86_64-w64-mingw32.static
|
||||
else
|
||||
MXETARGETDIR=$MXEDIR/usr/i686-pc-mingw32
|
||||
MXETARGETDIR=$MXEDIR/usr/i686-w64-mingw32.static
|
||||
fi
|
||||
|
||||
if [ ! $MINGWX_SAVED_ORIGINAL_PATH ]; then
|
||||
|
|
|
@ -91,7 +91,7 @@ FontCache::FontCache()
|
|||
// For system installs and dev environments, we leave this alone
|
||||
fs::path fontdir(fs::path(PlatformUtils::resourcesPath()) / "fonts");
|
||||
if (fs::is_regular_file(fontdir / "fonts.conf")) {
|
||||
setenv("FONTCONFIG_PATH", boosty::stringy(boosty::absolute(fontdir)).c_str(), 0);
|
||||
PlatformUtils::setenv("FONTCONFIG_PATH", boosty::stringy(boosty::absolute(fontdir)).c_str(), 0);
|
||||
}
|
||||
|
||||
// Just load the configs. We'll build the fonts once all configs are loaded
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "PlatformUtils.h"
|
||||
#include "boosty.h"
|
||||
#include <Eigen/Core>
|
||||
|
@ -124,3 +126,19 @@ std::string PlatformUtils::resourcesPath()
|
|||
// resourcedir defaults to applicationPath
|
||||
return boosty::stringy(boosty::canonical(resourcedir));
|
||||
}
|
||||
|
||||
int PlatformUtils::setenv(const char *name, const char *value, int overwrite)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
const char *ptr = getenv(name);
|
||||
if ((overwrite == 0) && (ptr != NULL)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
char buf[4096];
|
||||
snprintf(buf, sizeof(buf), "%s=%s", name, value);
|
||||
return _putenv(buf);
|
||||
#else
|
||||
return ::setenv(name, value, overwrite);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -13,7 +13,17 @@ namespace PlatformUtils {
|
|||
bool createUserLibraryPath();
|
||||
std::string backupPath();
|
||||
bool createBackupPath();
|
||||
|
||||
|
||||
/**
|
||||
* Platform abstraction to set environment variables. Windows/MinGW
|
||||
* does not support setenv(), but needs _putenv().
|
||||
*
|
||||
* @param name name of the environment variable.
|
||||
* @param value the value to set for the environment variable.
|
||||
* @return 0 on success.
|
||||
*/
|
||||
int setenv(const char *name, const char *value, int overwrite);
|
||||
|
||||
/**
|
||||
* Single character separating path specifications in a list
|
||||
* (e.g. OPENSCADPATH). On Windows that's ';' and on most other
|
||||
|
|
Loading…
Reference in New Issue