Files
CMake/Tests/CompileDefinitions/main.cpp
Stephen Kelly 3dae652b4e Don't duplicate -D defines sent to the compiler.
There is no need to do so. Be consistent with include directories and
ensure uniqueness.

This requires changing the API of the cmLocalGenerator::AppendDefines
method, and changing the generators to match.

The test unfortunately can't test for uniqueness, but it at least verifies
that nothing gets lost.
2012-08-20 22:30:11 +02:00

29 lines
570 B
C++

#ifndef CMAKE_IS_FUN
#error Expect CMAKE_IS_FUN definition
#endif
#if CMAKE_IS != Fun
#error Expect CMAKE_IS=Fun definition
#endif
template<bool test>
struct CMakeStaticAssert;
template<>
struct CMakeStaticAssert<true> {};
static const char fun_string[] = CMAKE_IS_;
static const char very_fun_string[] = CMAKE_IS_REALLY;
enum {
StringLiteralTest1 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_) == sizeof("Fun")>),
StringLiteralTest2 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_REALLY) == sizeof("Very Fun")>)
};
int main(int argc, char **argv)
{
return 0;
}