From ba0a8905395ec7e616bbedee33a83fcf15a86910 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 6 Sep 2010 12:43:57 -0400 Subject: Only test for .CPP on Microsoft compilers which will handle .CPP as c++. --- Tests/CxxOnly/CMakeLists.txt | 5 ++++- Tests/CxxOnly/cxxonly.cxx | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index 8258eb4..4654f44 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -2,7 +2,10 @@ project (CxxOnly CXX) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -add_library(testcxx1 STATIC libcxx1.cxx test.CPP) +if(MSVC) + set(EXTRA_SRCS test.CPP) +endif() +add_library(testcxx1 STATIC libcxx1.cxx ${EXTRA_SRCS}) add_library(testcxx2 SHARED libcxx2.cxx) add_executable (CxxOnly cxxonly.cxx) target_link_libraries(CxxOnly testcxx1 testcxx2) diff --git a/Tests/CxxOnly/cxxonly.cxx b/Tests/CxxOnly/cxxonly.cxx index bd4fd59..9cf6f2d 100644 --- a/Tests/CxxOnly/cxxonly.cxx +++ b/Tests/CxxOnly/cxxonly.cxx @@ -1,12 +1,16 @@ #include "libcxx1.h" #include "libcxx2.h" +#ifdef _MSC_VER extern int testCPP; +#endif #include int main () { +#ifdef _MSC_VER testCPP = 1; +#endif if ( LibCxx1Class::Method() != 2.0 ) { printf("Problem with libcxx1\n"); -- cgit v0.12