Merge topic 'fix-genex-CONFIG'
9be64f3
GenEx: Use case insensitive comparison for $<CONFIG:...>
This commit is contained in:
commit
11b8a44cfc
|
@ -16,6 +16,8 @@
|
||||||
#include "cmGeneratorExpressionDAGChecker.h"
|
#include "cmGeneratorExpressionDAGChecker.h"
|
||||||
#include "cmGeneratorExpression.h"
|
#include "cmGeneratorExpression.h"
|
||||||
|
|
||||||
|
#include <cmsys/String.h>
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
#if !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x510
|
#if !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x510
|
||||||
static
|
static
|
||||||
|
@ -253,7 +255,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
|
||||||
return parameters.front().empty() ? "1" : "0";
|
return parameters.front().empty() ? "1" : "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
return *parameters.begin() == context->Config ? "1" : "0";
|
return cmsysString_strcasecmp(parameters.begin()->c_str(),
|
||||||
|
context->Config) == 0 ? "1" : "0";
|
||||||
}
|
}
|
||||||
} configurationTestNode;
|
} configurationTestNode;
|
||||||
|
|
||||||
|
|
|
@ -556,6 +556,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
|
||||||
--build-generator ${CMAKE_TEST_GENERATOR}
|
--build-generator ${CMAKE_TEST_GENERATOR}
|
||||||
--build-project GeneratorExpression
|
--build-project GeneratorExpression
|
||||||
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
|
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
|
||||||
|
--build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
|
||||||
)
|
)
|
||||||
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression")
|
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression")
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,10 @@ add_custom_target(check ALL
|
||||||
-Dtest_and_0_invalidcontent=$<AND:0,invalidcontent>
|
-Dtest_and_0_invalidcontent=$<AND:0,invalidcontent>
|
||||||
-Dtest_config_0=$<CONFIG:$<CONFIGURATION>x>
|
-Dtest_config_0=$<CONFIG:$<CONFIGURATION>x>
|
||||||
-Dtest_config_1=$<CONFIG:$<CONFIGURATION>>
|
-Dtest_config_1=$<CONFIG:$<CONFIGURATION>>
|
||||||
|
-Dtest_config_debug=$<CONFIG:Debug>$<CONFIG:DEBUG>$<CONFIG:DeBuG>
|
||||||
|
-Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE>$<CONFIG:ReLeAsE>
|
||||||
|
-Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo>$<CONFIG:RELWITHDEBINFO>$<CONFIG:relwithdebinfo>
|
||||||
|
-Dtest_config_minsizerel=$<CONFIG:MinSizeRel>$<CONFIG:MINSIZEREL>$<CONFIG:minsizerel>
|
||||||
-Dtest_not_0=$<NOT:0>
|
-Dtest_not_0=$<NOT:0>
|
||||||
-Dtest_not_1=$<NOT:1>
|
-Dtest_not_1=$<NOT:1>
|
||||||
-Dtest_or_0=$<OR:0>
|
-Dtest_or_0=$<OR:0>
|
||||||
|
|
|
@ -18,6 +18,11 @@ check(test_and_1_1 "1")
|
||||||
check(test_and_0_invalidcontent "0")
|
check(test_and_0_invalidcontent "0")
|
||||||
check(test_config_0 "0")
|
check(test_config_0 "0")
|
||||||
check(test_config_1 "1")
|
check(test_config_1 "1")
|
||||||
|
foreach(c debug release relwithdebinfo minsizerel)
|
||||||
|
if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$")
|
||||||
|
message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
check(test_not_0 "1")
|
check(test_not_0 "1")
|
||||||
check(test_not_1 "0")
|
check(test_not_1 "0")
|
||||||
check(test_or_0 "0")
|
check(test_or_0 "0")
|
||||||
|
|
Loading…
Reference in New Issue