Created
March 28, 2016 07:09
-
-
Save orgads/8f759a46051e050011d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Product { | |
name: "UnitTests" | |
property string absCommon: FileInfo.joinPaths(buildDirectory, "Common"); | |
Rule { | |
id: unitTestEnabled | |
inputs: ["qbs"] | |
Artifact { | |
filePath: FileInfo.joinPaths(product.absCommon, "UnitTestEnabled.h") | |
fileTags: ["hpp"] | |
} | |
prepare: { | |
var cmd = new JavaScriptCommand(); | |
cmd.description = 'generating ' + output.fileName; | |
cmd.highlight = 'codegen'; | |
cmd.testsEnabled = project.gtest; | |
cmd.sourceCode = function() { | |
console.error(output.filePath) | |
var file = new TextFile(output.filePath, TextFile.WriteOnly); | |
file.truncate(); | |
if (testsEnabled) | |
file.write("#define WITH_TESTS 1\n"); | |
file.close(); | |
} | |
return cmd; | |
} | |
} | |
Export { | |
Depends { name: "cpp" } | |
cpp.includePaths: product.absCommon | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment