diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-08-09 07:44:15 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2012-08-20 20:30:11 (GMT) |
commit | 3dae652b4ea8e039dd9f4d845497ec988fbbe82c (patch) | |
tree | 22241a616f674ac6fe82375690e8485d19e32725 /Tests/CompileDefinitions/main.cpp | |
parent | d46f8afae98cd8f50cff9915a5a9dc680b9e0518 (diff) | |
download | CMake-3dae652b4ea8e039dd9f4d845497ec988fbbe82c.zip CMake-3dae652b4ea8e039dd9f4d845497ec988fbbe82c.tar.gz CMake-3dae652b4ea8e039dd9f4d845497ec988fbbe82c.tar.bz2 |
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.
Diffstat (limited to 'Tests/CompileDefinitions/main.cpp')
-rw-r--r-- | Tests/CompileDefinitions/main.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Tests/CompileDefinitions/main.cpp b/Tests/CompileDefinitions/main.cpp new file mode 100644 index 0000000..d80c9dc --- /dev/null +++ b/Tests/CompileDefinitions/main.cpp @@ -0,0 +1,28 @@ + +#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; +} |