|
|
@@ -692,6 +692,28 @@ static const struct CXXCompilerIdNode : public CompilerIdNode
|
|
|
}
|
|
|
} cxxCompilerIdNode;
|
|
|
|
|
|
+static const struct CUDACompilerIdNode : public CompilerIdNode
|
|
|
+{
|
|
|
+ CUDACompilerIdNode() {} // NOLINT(modernize-use-equals-default)
|
|
|
+
|
|
|
+ std::string Evaluate(
|
|
|
+ const std::vector<std::string>& parameters,
|
|
|
+ cmGeneratorExpressionContext* context,
|
|
|
+ const GeneratorExpressionContent* content,
|
|
|
+ cmGeneratorExpressionDAGChecker* dagChecker) const override
|
|
|
+ {
|
|
|
+ if (!context->HeadTarget) {
|
|
|
+ reportError(
|
|
|
+ context, content->GetOriginalExpression(),
|
|
|
+ "$<CUDA_COMPILER_ID> may only be used with binary targets. It may "
|
|
|
+ "not be used with add_custom_command or add_custom_target.");
|
|
|
+ return std::string();
|
|
|
+ }
|
|
|
+ return this->EvaluateWithLanguage(parameters, context, content, dagChecker,
|
|
|
+ "CUDA");
|
|
|
+ }
|
|
|
+} cudaCompilerIdNode;
|
|
|
+
|
|
|
static const struct FortranCompilerIdNode : public CompilerIdNode
|
|
|
{
|
|
|
FortranCompilerIdNode() {} // NOLINT(modernize-use-equals-default)
|
|
|
@@ -773,9 +795,9 @@ static const struct CCompilerVersionNode : public CompilerVersionNode
|
|
|
}
|
|
|
} cCompilerVersionNode;
|
|
|
|
|
|
-static const struct CxxCompilerVersionNode : public CompilerVersionNode
|
|
|
+static const struct CXXCompilerVersionNode : public CompilerVersionNode
|
|
|
{
|
|
|
- CxxCompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
|
|
|
+ CXXCompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
|
|
|
|
|
|
std::string Evaluate(
|
|
|
const std::vector<std::string>& parameters,
|
|
|
@@ -795,6 +817,28 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode
|
|
|
}
|
|
|
} cxxCompilerVersionNode;
|
|
|
|
|
|
+static const struct CUDACompilerVersionNode : public CompilerVersionNode
|
|
|
+{
|
|
|
+ CUDACompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
|
|
|
+
|
|
|
+ std::string Evaluate(
|
|
|
+ const std::vector<std::string>& parameters,
|
|
|
+ cmGeneratorExpressionContext* context,
|
|
|
+ const GeneratorExpressionContent* content,
|
|
|
+ cmGeneratorExpressionDAGChecker* dagChecker) const override
|
|
|
+ {
|
|
|
+ if (!context->HeadTarget) {
|
|
|
+ reportError(
|
|
|
+ context, content->GetOriginalExpression(),
|
|
|
+ "$<CUDA_COMPILER_VERSION> may only be used with binary targets. It "
|
|
|
+ "may not be used with add_custom_command or add_custom_target.");
|
|
|
+ return std::string();
|
|
|
+ }
|
|
|
+ return this->EvaluateWithLanguage(parameters, context, content, dagChecker,
|
|
|
+ "CUDA");
|
|
|
+ }
|
|
|
+} cudaCompilerVersionNode;
|
|
|
+
|
|
|
static const struct FortranCompilerVersionNode : public CompilerVersionNode
|
|
|
{
|
|
|
FortranCompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
|
|
|
@@ -2082,6 +2126,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(
|
|
|
{ "NOT", ¬Node },
|
|
|
{ "C_COMPILER_ID", &cCompilerIdNode },
|
|
|
{ "CXX_COMPILER_ID", &cxxCompilerIdNode },
|
|
|
+ { "CUDA_COMPILER_ID", &cudaCompilerIdNode },
|
|
|
{ "Fortran_COMPILER_ID", &fortranCompilerIdNode },
|
|
|
{ "VERSION_GREATER", &versionGreaterNode },
|
|
|
{ "VERSION_GREATER_EQUAL", &versionGreaterEqNode },
|
|
|
@@ -2090,6 +2135,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(
|
|
|
{ "VERSION_EQUAL", &versionEqualNode },
|
|
|
{ "C_COMPILER_VERSION", &cCompilerVersionNode },
|
|
|
{ "CXX_COMPILER_VERSION", &cxxCompilerVersionNode },
|
|
|
+ { "CUDA_COMPILER_VERSION", &cudaCompilerVersionNode },
|
|
|
{ "Fortran_COMPILER_VERSION", &fortranCompilerVersionNode },
|
|
|
{ "PLATFORM_ID", &platformIdNode },
|
|
|
{ "COMPILE_FEATURES", &compileFeaturesNode },
|