From 76e14b4f1a53e295613593a8c731d39db2617c1a Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 29 Jul 2005 14:02:51 -0400 Subject: ENH: do not test for c and cxx flags on visual studio as it does not work yet --- Tests/Complex/Executable/complex.cxx | 28 ++++++++++++++--------- Tests/Complex/cmTestConfigure.h.in | 1 + Tests/ComplexOneConfig/Executable/complex.cxx | 28 ++++++++++++++--------- Tests/ComplexOneConfig/cmTestConfigure.h.in | 1 + Tests/ComplexRelativePaths/Executable/complex.cxx | 28 ++++++++++++++--------- Tests/ComplexRelativePaths/cmTestConfigure.h.in | 1 + 6 files changed, 54 insertions(+), 33 deletions(-) diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index a8356f1..1a35978 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -374,21 +374,27 @@ int main() #else cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler."); #endif + std::string gen = CMAKE_GENERATOR; + // visual studio is currently broken for c flags + if(gen.find("Visual") == gen.npos) + { #ifdef TEST_C_FLAGS - cmFailed("CMake CMAKE_C_FLAGS are being passed to c++ files the compiler!"); + cmFailed("CMake CMAKE_C_FLAGS are being passed to c++ files the compiler!"); #else - cmPassed("CMake CMAKE_C_FLAGS are not being passed to c++ files."); + cmPassed("CMake CMAKE_C_FLAGS are not being passed to c++ files."); #endif - char msg[1024]; - if(TestCFlags(msg)) - { - cmPassed( - "CMake CMAKE_C_FLAGS are being passed to c files and CXX flags are not."); - } - else - { - cmFailed(msg); + char msg[1024]; + if(TestCFlags(msg)) + { + cmPassed( + "CMake CMAKE_C_FLAGS are being passed to c files and CXX flags are not."); + } + else + { + cmFailed(msg); + } } + // ---------------------------------------------------------------------- // Test ADD_DEFINITIONS diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in index 35c10b4..9dbdd0b 100644 --- a/Tests/Complex/cmTestConfigure.h.in +++ b/Tests/Complex/cmTestConfigure.h.in @@ -70,3 +70,4 @@ // Test SET CACHE FORCE #cmakedefine FORCE_TEST +#define CMAKE_GENERATOR "${CMAKE_GENERATOR}" diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index a8356f1..1a35978 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -374,21 +374,27 @@ int main() #else cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler."); #endif + std::string gen = CMAKE_GENERATOR; + // visual studio is currently broken for c flags + if(gen.find("Visual") == gen.npos) + { #ifdef TEST_C_FLAGS - cmFailed("CMake CMAKE_C_FLAGS are being passed to c++ files the compiler!"); + cmFailed("CMake CMAKE_C_FLAGS are being passed to c++ files the compiler!"); #else - cmPassed("CMake CMAKE_C_FLAGS are not being passed to c++ files."); + cmPassed("CMake CMAKE_C_FLAGS are not being passed to c++ files."); #endif - char msg[1024]; - if(TestCFlags(msg)) - { - cmPassed( - "CMake CMAKE_C_FLAGS are being passed to c files and CXX flags are not."); - } - else - { - cmFailed(msg); + char msg[1024]; + if(TestCFlags(msg)) + { + cmPassed( + "CMake CMAKE_C_FLAGS are being passed to c files and CXX flags are not."); + } + else + { + cmFailed(msg); + } } + // ---------------------------------------------------------------------- // Test ADD_DEFINITIONS diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in index 35c10b4..9dbdd0b 100644 --- a/Tests/ComplexOneConfig/cmTestConfigure.h.in +++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in @@ -70,3 +70,4 @@ // Test SET CACHE FORCE #cmakedefine FORCE_TEST +#define CMAKE_GENERATOR "${CMAKE_GENERATOR}" diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx index a8356f1..1a35978 100644 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ b/Tests/ComplexRelativePaths/Executable/complex.cxx @@ -374,21 +374,27 @@ int main() #else cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler."); #endif + std::string gen = CMAKE_GENERATOR; + // visual studio is currently broken for c flags + if(gen.find("Visual") == gen.npos) + { #ifdef TEST_C_FLAGS - cmFailed("CMake CMAKE_C_FLAGS are being passed to c++ files the compiler!"); + cmFailed("CMake CMAKE_C_FLAGS are being passed to c++ files the compiler!"); #else - cmPassed("CMake CMAKE_C_FLAGS are not being passed to c++ files."); + cmPassed("CMake CMAKE_C_FLAGS are not being passed to c++ files."); #endif - char msg[1024]; - if(TestCFlags(msg)) - { - cmPassed( - "CMake CMAKE_C_FLAGS are being passed to c files and CXX flags are not."); - } - else - { - cmFailed(msg); + char msg[1024]; + if(TestCFlags(msg)) + { + cmPassed( + "CMake CMAKE_C_FLAGS are being passed to c files and CXX flags are not."); + } + else + { + cmFailed(msg); + } } + // ---------------------------------------------------------------------- // Test ADD_DEFINITIONS diff --git a/Tests/ComplexRelativePaths/cmTestConfigure.h.in b/Tests/ComplexRelativePaths/cmTestConfigure.h.in index 35c10b4..9dbdd0b 100644 --- a/Tests/ComplexRelativePaths/cmTestConfigure.h.in +++ b/Tests/ComplexRelativePaths/cmTestConfigure.h.in @@ -70,3 +70,4 @@ // Test SET CACHE FORCE #cmakedefine FORCE_TEST +#define CMAKE_GENERATOR "${CMAKE_GENERATOR}" -- cgit v0.12