mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 15:10:20 -06:00
Rename files from main.cpp to more meaningful names.
Because the main file for the dummy-executable and the actual compile test were both called main.cpp, they were overwriting each other during in-source builds.
This commit is contained in:
33
Tests/CompileDefinitions/compiletest.cpp
Normal file
33
Tests/CompileDefinitions/compiletest.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
#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_;
|
||||
#ifndef NO_SPACES_IN_DEFINE_VALUES
|
||||
static const char very_fun_string[] = CMAKE_IS_REALLY;
|
||||
#endif
|
||||
|
||||
enum {
|
||||
StringLiteralTest1 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_) == sizeof("Fun")>)
|
||||
#ifndef NO_SPACES_IN_DEFINE_VALUES
|
||||
,
|
||||
StringLiteralTest2 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_REALLY) == sizeof("Very Fun")>)
|
||||
#endif
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user