MCPcopy Create free account
hub / github.com/Kitware/CMake / main

Function main

Tests/Complex/Executable/complex.cxx:133–1064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131// ======================================================================
132
133int main()
134{
135#if 0
136 if(NameConflictTest1() == 0 && NameConflictTest2() == 0)
137 {
138 cmPassed("Sub dir with same named source works");
139 }
140 else
141 {
142 cmFailed("Sub dir with same named source fails");
143 }
144#endif
145 if (file1() != 1) {
146 cmFailed("Call to file1 function from library failed.");
147 } else {
148 cmPassed("Call to file1 function returned 1.");
149 }
150#ifndef COMPLEX_TARGET_FLAG
151 cmFailed("COMPILE_FLAGS did not work with SET_TARGET_PROPERTIES");
152#else
153 cmPassed("COMPILE_FLAGS did work with SET_TARGET_PROPERTIES");
154#endif
155
156#ifdef ELSEIF_RESULT
157 cmPassed("ELSEIF did work");
158#else
159 cmFailed("ELSEIF did not work");
160#endif
161
162#ifdef CONDITIONAL_PARENTHESES
163 cmPassed("CONDITIONAL_PARENTHESES did work");
164#else
165 cmFailed("CONDITIONAL_PARENTHESES did not work");
166#endif
167
168 if (file2() != 1) {
169 cmFailed("Call to file2 function from library failed.");
170 } else {
171 cmPassed("Call to file2 function returned 1.");
172 }
173#ifndef TEST_CXX_FLAGS
174 cmFailed("CMake CMAKE_CXX_FLAGS is not being passed to the compiler!");
175#else
176 cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler.");
177#endif
178 std::string gen = CMAKE_GENERATOR;
179 // visual studio is currently broken for c flags
180 char msg[1024];
181 if (gen.find("Visual") == gen.npos) {
182#ifdef TEST_C_FLAGS
183 cmFailed(
184 "CMake CMAKE_C_FLAGS are being passed to c++ files the compiler!");
185#else
186 cmPassed("CMake CMAKE_C_FLAGS are not being passed to c++ files.");
187#endif
188 if (TestCFlags(msg)) {
189 cmPassed("CMake CMAKE_C_FLAGS are being passed to c files and CXX flags "
190 "are not.");

Callers

nothing calls this directly

Calls 12

cmPassedFunction · 0.70
cmFailedFunction · 0.70
TestCFlagsFunction · 0.70
TestTargetCompileFlagsFunction · 0.70
TestAndRemoveFileFunction · 0.70
TestDirFunction · 0.70
NameConflictTest1Function · 0.50
NameConflictTest2Function · 0.50
file1Function · 0.50
file2Function · 0.50
TestLinkGetTypeFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…