Skip to content

Commit

Permalink
Fix #44: Debian 0.2.1 release on Fedora Rawhide
Browse files Browse the repository at this point in the history
Make the input file optional. This allows access to Clang flags which
don't take any arguments.
  • Loading branch information
jacob-carlborg committed Jan 16, 2016
1 parent c5b6a60 commit 951781b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [ -s "$HOME/.dvm/scripts/dvm" ] ; then
. "$HOME/.dvm/scripts/dvm" ;
dvm use 2.066.1
dvm use 2.069.2
fi

dub build
Expand Down
18 changes: 13 additions & 5 deletions dstep/driver/Application.d
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,15 @@ class Application : DStack.Application
protected override void run ()
{
handleArguments;
inputFiles ~= arguments.argument.input;
startConversion(inputFiles.first);

if (arguments.argument.input.hasValue)
{
inputFiles ~= arguments.argument.input;
startConversion(inputFiles.first);
}

else
startConversion("");
}

protected override void setupArguments ()
Expand Down Expand Up @@ -88,15 +95,16 @@ private:
translationUnit = TranslationUnit.parse(index, file, compilerArgs,
compiler.extraHeaders);

if (!translationUnit.isValid)
throw new DStepException("An unknown error occurred");
// hope that the diagnostics below handle everything
// if (!translationUnit.isValid)
// throw new DStepException("An unknown error occurred");

diagnostics = translationUnit.diagnostics;

scope (exit)
clean;

if (handleDiagnostics)
if (handleDiagnostics && file.any)
{
Translator.Options options;
options.outputFile = arguments.output;
Expand Down
2 changes: 1 addition & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
],

"dependencies": {
"dstack": "0.0.4"
"dstack": "~>0.0.5"
}
}
4 changes: 2 additions & 2 deletions dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"fileVersion": 1,
"versions": {
"dstack": "0.0.4",
"mambo": "0.0.6",
"dstack": "0.0.5",
"mambo": "0.0.7",
"tango": "1.0.3+2.068"
}
}

0 comments on commit 951781b

Please sign in to comment.