Enable experimental features only for snapshot builds

jawsreader
Marius Kintel 2014-02-23 15:47:26 -05:00
parent 2712465a1d
commit 3ac8895d7a
6 changed files with 33 additions and 16 deletions

View File

@ -160,6 +160,11 @@ CONFIG += glib-2.0
#Uncomment the following line to enable QCodeEdit
#CONFIG += qcodeedit
# Make experimental features available
experimental {
DEFINES += ENABLE_EXPERIMENTAL
}
mdi {
DEFINES += ENABLE_MDI
}

View File

@ -46,8 +46,7 @@ if test -z "$VERSIONDATE"; then
fi
if test -z "$VERSION"; then
VERSION=$VERSIONDATE
COMMIT=-c
SNAPSHOT=true
SNAPSHOT=snapshot
fi
# Turn off ccache, just for safety
@ -59,7 +58,7 @@ export OPENSCAD_LIBRARIES=$PWD/../libraries/homebrew
# Make sure that the correct Qt tools are used
export PATH=$OPENSCAD_LIBRARIES/bin:$PATH
`dirname $0`/release-common.sh -v $VERSION $COMMIT
`dirname $0`/release-common.sh -v $VERSION $SNAPSHOT
if [[ $? != 0 ]]; then
exit 1
fi

View File

@ -10,17 +10,14 @@
# Usage: release-common.sh [-v <versionstring>] [-c] [-mingw[32|64]]
# -v Version string (e.g. -v 2010.01)
# -d Version date (e.g. -d 2010.01.23)
# -c Build with commit info
# -mingw32 Cross-compile for win32 using MXE
# -mingw64 Cross-compile for win64 using Tony Theodore's MXE fork
# -mingw64 Cross-compile for win64 using MXE
# -snapshot Build a snapshot binary (make e.g. experimental features available, build with commit info)
#
# If no version string or version date is given, todays date will be used (YYYY-MM-DD)
# If only verion date is given, it will be used also as version string.
# If only version date is given, it will be used also as version string.
# If no make target is given, release will be used on Windows, none one Mac OS X
#
# The commit info will extracted from git and be passed to qmake as OPENSCAD_COMMIT
# to identify a build in the about box.
#
# The mingw cross compile depends on the MXE cross-build tools. Please
# see the README.md file on how to install these dependencies.
@ -37,6 +34,8 @@ if [ ! -f $OPENSCADDIR/openscad.pro ]; then
exit 1
fi
CONFIG=deploy
if [[ "$OSTYPE" =~ "darwin" ]]; then
OS=MACOSX
elif [[ $OSTYPE == "msys" ]]; then
@ -63,6 +62,11 @@ if [ "`echo $* | grep mingw64`" ]; then
echo Mingw-cross build using ARCH=64
fi
if [ "`echo $* | grep snapshot`" ]; then
CONFIG="$CONFIG experimental"
OPENSCAD_COMMIT=`git log -1 --pretty=format:"%h"`
fi
if [ $OS ]; then
echo "Detected OS: $OS"
else
@ -75,7 +79,6 @@ do
case $c in
v) VERSION=$OPTARG;;
d) VERSIONDATE=$OPTARG;;
c) OPENSCAD_COMMIT=`git log -1 --pretty=format:"%h"`
esac
done
@ -116,7 +119,7 @@ if [ -d .git ]; then
git submodule update
fi
echo "Building openscad-$VERSION ($VERSIONDATE) $CONFIGURATION..."
echo "Building openscad-$VERSION ($VERSIONDATE) $CONFIG..."
if [ ! $NUMCPU ]; then
echo "note: you can 'export NUMCPU=x' for multi-core compiles (x=number)";
@ -124,7 +127,6 @@ if [ ! $NUMCPU ]; then
fi
echo "NUMCPU: " $NUMCPU
CONFIG=deploy
case $OS in
LINUX|MACOSX)
TARGET=
@ -148,11 +150,11 @@ esac
case $OS in
UNIX_CROSS_WIN)
cd $DEPLOYDIR && qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+=$CONFIG CONFIG+=mingw-cross-env CONFIG-=debug ../openscad.pro
cd $DEPLOYDIR && qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+="$CONFIG" CONFIG+=mingw-cross-env CONFIG-=debug ../openscad.pro
cd $OPENSCADDIR
;;
*)
qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+=$CONFIG CONFIG-=debug openscad.pro
qmake VERSION=$VERSION OPENSCAD_COMMIT=$OPENSCAD_COMMIT CONFIG+="$CONFIG" CONFIG-=debug openscad.pro
;;
esac

View File

@ -96,7 +96,11 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
addPrefPage(group, prefsAction3DView, page3DView);
addPrefPage(group, prefsActionEditor, pageEditor);
addPrefPage(group, prefsActionUpdate, pageUpdate);
#ifdef ENABLE_EXPERIMENTAL
addPrefPage(group, prefsActionFeatures, pageFeatures);
#else
this->toolBar->removeAction(prefsActionFeatures);
#endif
addPrefPage(group, prefsActionAdvanced, pageAdvanced);
connect(group, SIGNAL(triggered(QAction*)), this, SLOT(actionTriggered(QAction*)));

View File

@ -114,7 +114,9 @@ static void help(const char *progname)
"%2%[ --imgsize=width,height ] [ --projection=(o)rtho|(p)ersp] \\\n"
"%2%[ --render | --preview[=throwntogether] ] \\\n"
"%2%[ --csglimit=num ] \\\n"
#ifdef ENABLE_EXPERIMENTAL
"%2%[ --enable=<feature> ] \\\n"
#endif
"%2%filename\n",
progname % (const char *)tabstr);
exit(1);
@ -597,7 +599,10 @@ int main(int argc, char **argv)
("d,d", po::value<string>(), "deps-file")
("m,m", po::value<string>(), "makefile")
("D,D", po::value<vector<string> >(), "var=val")
("enable", po::value<vector<string> >(), "enable experimental features");
#ifdef ENABLE_EXPERIMENTAL
("enable", po::value<vector<string> >(), "enable experimental features")
#endif
;
po::options_description hidden("Hidden options");
hidden.add_options()
@ -665,11 +670,13 @@ int main(int argc, char **argv)
commandline_commands += ";\n";
}
}
#ifdef ENABLE_EXPERIMENTAL
if (vm.count("enable")) {
BOOST_FOREACH(const string &feature, vm["enable"].as<vector<string> >()) {
Feature::enable_feature(feature);
}
}
#endif
vector<string> inputFiles;
if (vm.count("input-file")) {
inputFiles = vm["input-file"].as<vector<string> >();

View File

@ -477,7 +477,7 @@ if (DEFINED OPENSCAD_DAY)
add_definitions(-DOPENSCAD_DAY=${OPENSCAD_DAY})
endif()
add_definitions(-DOPENSCAD_TESTING)
add_definitions(-DOPENSCAD_TESTING -DENABLE_EXPERIMENTAL)
# Search for MCAD in correct place
set(CTEST_ENVIRONMENT "${CTEST_ENVIRONMENT};OPENSCADPATH=${CMAKE_CURRENT_SOURCE_DIR}/../libraries")