[Cmake-commits] CMake branch, next, updated. v2.8.11-1995-ge188cfa
Stephen Kelly
steveire at gmail.com
Thu May 16 14:35:56 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via e188cfa72f30287b79d24a00ac443cbd866adca7 (commit)
via 87a88e3ff81cd1b7e10f35e961e8488aa5311df5 (commit)
via 78d0a43d7f53b500c924ed88d77afec0381d5f7b (commit)
via b47de749d9f8c38391b0a6e16b5db968b1fe47ca (commit)
via 471eacc5664fc6d2d9366e9073ff945f3a6920b7 (commit)
via 481129b1780772acd0ec856ded9344508c8a76c2 (commit)
via fd5928cdcf48c07a49e70f11030e5cd7de62f9ad (commit)
from 41c18c453b5587debec1d3c2f829d25aa920bd4a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e188cfa72f30287b79d24a00ac443cbd866adca7
commit e188cfa72f30287b79d24a00ac443cbd866adca7
Merge: 41c18c4 87a88e3
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu May 16 14:35:53 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu May 16 14:35:53 2013 -0400
Merge topic 'generate_export_header-fixes' into next
87a88e3 Prepare tests to use non-default languages with project().
78d0a43 GenerateExportHeader: Refactor the function for adding compile flags
b47de74 Declare C functions with an explicit void argument.
471eacc Wrap the use of classes in __cplusplus.
481129b Add missing test for exported free-function.
fd5928c Add some newlines to separate the failure message compiler output.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87a88e3ff81cd1b7e10f35e961e8488aa5311df5
commit 87a88e3ff81cd1b7e10f35e961e8488aa5311df5
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 16 09:50:51 2012 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 16 20:03:59 2013 +0200
Prepare tests to use non-default languages with project().
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 454f37a..3bbf3d2 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -82,7 +82,7 @@ set(TEST_TOP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
# We seem to get race conditions is writing this stuff to the same file at least on MinGW
# So to write to separate source and build directories, we use a count to differentiate.
set (COUNT 0)
-macro(_do_build Include Library LibrarySource Source)
+macro(_do_build Include Library LibrarySource Source Languages)
math(EXPR COUNT "${COUNT} + 1" )
@@ -97,7 +97,7 @@ macro(_do_build Include Library LibrarySource Source)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
"cmake_minimum_required(VERSION 2.8)\n"
- "project(compiletest)\n"
+ "project(compiletest ${Languages})\n"
"set(CMAKE_INCLUDE_CURRENT_DIR ON)\n"
@@ -129,13 +129,13 @@ macro(_do_build Include Library LibrarySource Source)
)
endmacro()
-macro(build_fail Include Library LibrarySource Source Message)
- _do_build(${Include} ${Library} ${LibrarySource} "${Source}")
+macro(build_fail Include Library LibrarySource Source Message Languages)
+ _do_build(${Include} ${Library} ${LibrarySource} "${Source}" "${Languages}")
test_fail(Result ${Message})
endmacro()
-macro(build_pass Include Library LibrarySource Source Message)
- _do_build(${Include} ${Library} ${LibrarySource} "${Source}")
+macro(build_pass Include Library LibrarySource Source Message Languages)
+ _do_build(${Include} ${Library} ${LibrarySource} "${Source}" "${Languages}")
test_pass(Result ${Message})
endmacro()
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_statictest/CMakeLists.txt b/Tests/Module/GenerateExportHeader/lib_shared_and_statictest/CMakeLists.txt
index 207534d..7b9588a 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_statictest/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_statictest/CMakeLists.txt
@@ -1,33 +1,41 @@
-macro(shared_variant_build_pass Source Message)
- build_pass("libshared_and_static.h" "shared_variant" "lib_shared_and_static" "${Source}" ${Message})
+macro(shared_variant_build_pass Source Message Languages)
+ build_pass("libshared_and_static.h" "shared_variant" "lib_shared_and_static" "${Source}" ${Message} "${Languages}")
endmacro()
macro(shared_variant_build_fail Source Message)
- build_fail("libshared_and_static.h" "shared_variant" "lib_shared_and_static" "${Source}" ${Message})
+ build_fail("libshared_and_static.h" "shared_variant" "lib_shared_and_static" "${Source}" ${Message} "${Languages}")
endmacro()
macro(static_variant_build_pass Source Message)
- build_pass("libshared_and_static.h" "static_variant" "lib_shared_and_static" "${Source}" ${Message})
+ build_pass("libshared_and_static.h" "static_variant" "lib_shared_and_static" "${Source}" ${Message} "${Languages}")
endmacro()
macro(static_variant_build_fail Source Message)
- build_fail("libshared_and_static.h" "static_variant" "lib_shared_and_static" "${Source}" ${Message})
+ build_fail("libshared_and_static.h" "static_variant" "lib_shared_and_static" "${Source}" ${Message} "${Languages}")
endmacro()
-static_variant_build_pass("return libshared_and_static_exported();" "Failed to build static variant")
-shared_variant_build_pass("return libshared_and_static_exported();" "Failed to build shared variant")
-# if (COMPILER_HAS_DEPRECATED)
-# shared_variant_build_fail("return libshared_and_static_deprecated();" "Built shared deprecated variant")
-# static_variant_build_fail("return libshared_and_static_deprecated();" "Built static deprecated variant")
-# else()
-# shared_variant_build_pass("return libshared_and_static_deprecated();" "Built shared deprecated variant")
-# static_variant_build_pass("return libshared_and_static_deprecated();" "Built static deprecated variant")
-# endif()
-static_variant_build_pass("return libshared_and_static_not_exported();" "Failed to build static not exported variant")
-
-if (WIN32 OR COMPILER_HAS_HIDDEN_VISIBILITY)
- shared_variant_build_fail("return libshared_and_static_not_exported();" "Built shared not exported variant")
-else()
- shared_variant_build_pass("return libshared_and_static_not_exported();" "Built shared not exported variant")
-endif()
+
+macro(run_tests Languages)
+
+ static_variant_build_pass("return libshared_and_static_exported();" "Failed to build static variant\n" "${Languages}")
+ shared_variant_build_pass("return libshared_and_static_exported();" "Failed to build shared variant\n" "${Languages}")
+ # if (COMPILER_HAS_DEPRECATED)
+ # shared_variant_build_fail("return libshared_and_static_deprecated();" "Built shared deprecated variant")
+ # static_variant_build_fail("return libshared_and_static_deprecated();" "Built static deprecated variant")
+ # else()
+ # shared_variant_build_pass("return libshared_and_static_deprecated();" "Built shared deprecated variant")
+ # static_variant_build_pass("return libshared_and_static_deprecated();" "Built static deprecated variant")
+ # endif()
+ static_variant_build_pass("return libshared_and_static_not_exported();" "Failed to build static not exported variant\n" "${Languages}")
+
+ if (WIN32 OR COMPILER_HAS_HIDDEN_VISIBILITY)
+ shared_variant_build_fail("return libshared_and_static_not_exported();" "Built shared not exported variant\n" "${Languages}")
+ else()
+ shared_variant_build_pass("return libshared_and_static_not_exported();" "Built shared not exported variant" "${Languages}")
+ endif()
+endmacro()
+
+run_tests("")
+run_tests("CXX")
+run_tests("C CXX")
diff --git a/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt b/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt
index 2a97d8f..19592c4 100644
--- a/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt
@@ -1,14 +1,13 @@
macro(shared_build_pass Source Message)
- build_pass("libshared.h" "libshared" "libshared" "${Source}" ${Message})
+ build_pass("libshared.h" "libshared" "libshared" "${Source}" ${Message} "${ARGN}")
endmacro()
macro(shared_build_fail Source Message)
- build_fail("libshared.h" "libshared" "libshared" "${Source}" ${Message})
+ build_fail("libshared.h" "libshared" "libshared" "${Source}" ${Message} "${ARGN}")
endmacro()
shared_build_pass("Libshared l; return l.libshared_exported();" "Failed to build exported")
-shared_build_pass("return libshared_exported();" "Failed to build exported function.")
# if (COMPILER_HAS_DEPRECATED)
# shared_build_fail("Libshared l; return l.libshared_deprecated();" "Built use of deprecated class method. This should not be possible.")
@@ -29,9 +28,6 @@ if (WIN32 OR COMPILER_HAS_HIDDEN_VISIBILITY)
shared_build_fail("LibsharedExcluded l; return l.libshared();" "Built use of excluded class method. This should not be possible.")
shared_build_fail("LibsharedExcluded l; return l.libshared_not_exported();" "Built use of excluded class method. This should not be possible.")
shared_build_fail("LibsharedExcluded l; return l.libshared_excluded();" "Built use of excluded class method. This should not be possible.")
-
- shared_build_fail("return libshared_excluded();" "Built use of excluded function. This should not be possible.")
- shared_build_fail("return libshared_not_exported();" "Built use of not-exported function. This should not be possible.")
else()
shared_build_pass("LibsharedNotExported l; return l.libshared();" "Built use of not-exported class method.")
shared_build_pass("LibsharedNotExported l; return l.libshared_not_exported();" "Built use of not-exported class method.")
@@ -39,7 +35,21 @@ else()
shared_build_pass("LibsharedExcluded l; return l.libshared();" "Built use of excluded class method.")
shared_build_pass("LibsharedExcluded l; return l.libshared_not_exported();" "Built use of excluded class method.")
shared_build_pass("LibsharedExcluded l; return l.libshared_excluded();" "Built use of excluded class method.")
-
- shared_build_pass("return libshared_excluded();" "Built use of excluded function.")
- shared_build_pass("return libshared_not_exported();" "Built use of not-exported function.")
endif()
+
+
+macro(run_tests Languages)
+ shared_build_pass("return libshared_exported();" "Failed to build exported function." "${Languages}")
+
+ if (WIN32 OR COMPILER_HAS_HIDDEN_VISIBILITY)
+ shared_build_fail("return libshared_excluded();" "Built use of excluded function. This should not be possible." "${Languages}")
+ shared_build_fail("return libshared_not_exported();" "Built use of not-exported function. This should not be possible." "${Languages}")
+ else()
+ shared_build_pass("return libshared_excluded();" "Built use of excluded function." "${Languages}")
+ shared_build_pass("return libshared_not_exported();" "Built use of not-exported function." "${Languages}")
+ endif()
+endmacro()
+
+run_tests("")
+run_tests("CXX")
+run_tests("C CXX")
diff --git a/Tests/Module/GenerateExportHeader/libstatictest/CMakeLists.txt b/Tests/Module/GenerateExportHeader/libstatictest/CMakeLists.txt
index eb6bb87..15771f3 100644
--- a/Tests/Module/GenerateExportHeader/libstatictest/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/libstatictest/CMakeLists.txt
@@ -1,10 +1,10 @@
macro(static_build_pass Source Message)
- build_pass("libstatic.h" "libstatic" "libstatic" "${Source}" ${Message})
+ build_pass("libstatic.h" "libstatic" "libstatic" "${Source}" ${Message} "")
endmacro()
macro(static_build_fail Source Message)
- build_fail("libstatic.h" "libstatic" "libstatic" "${Source}" ${Message})
+ build_fail("libstatic.h" "libstatic" "libstatic" "${Source}" ${Message} "")
endmacro()
static_build_pass("Libstatic l; return l.libstatic_exported();" "Failed to build exported.")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78d0a43d7f53b500c924ed88d77afec0381d5f7b
commit 78d0a43d7f53b500c924ed88d77afec0381d5f7b
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 16 09:46:08 2012 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 16 20:03:58 2013 +0200
GenerateExportHeader: Refactor the function for adding compile flags
This function will be repurposed to add both C and CXX flags.
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 892ebc6..ef7a05b 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -331,17 +331,28 @@ function(add_compiler_export_flags)
return()
endif()
- set (EXTRA_FLAGS "-fvisibility=hidden")
+ set (EXTRA_FLAGS_CXX "-fvisibility=hidden")
if(COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
- set (EXTRA_FLAGS "${EXTRA_FLAGS} -fvisibility-inlines-hidden")
+ set (EXTRA_FLAGS_CXX "${EXTRA_FLAGS_CXX} -fvisibility-inlines-hidden")
endif()
# Either return the extra flags needed in the supplied argument, or to the
# CMAKE_CXX_FLAGS if no argument is supplied.
if(ARGV0)
- set(${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE)
+ if (NOT "${ARGV0}" STREQUAL "CXX")
+ set(${ARGV0} "${EXTRA_FLAGS_CXX}" PARENT_SCOPE)
+ else()
+ set(options)
+ set(oneValueArgs CXX)
+ set(multiValueArgs)
+ cmake_parse_arguments(_CEF "${options}" "${oneValueArgs}" "${multiValueArgs}"
+ ${ARGN})
+ if (_CEF_CXX)
+ set(${_CEF_CXX} "${EXTRA_FLAGS_CXX}" PARENT_SCOPE)
+ endif()
+ endif()
else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS_CXX}" PARENT_SCOPE)
endif()
endfunction()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b47de749d9f8c38391b0a6e16b5db968b1fe47ca
commit b47de749d9f8c38391b0a6e16b5db968b1fe47ca
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Aug 19 23:55:12 2012 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 16 20:03:58 2013 +0200
Declare C functions with an explicit void argument.
This is required by Borland C.
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.cpp b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.cpp
index 909b06a..13c46bc 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.cpp
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.cpp
@@ -74,22 +74,22 @@ int LibsharedAndStaticExcluded::libshared_and_static_excluded() const {
#endif
-int libshared_and_static() {
+int libshared_and_static(void) {
return 0;
}
-int libshared_and_static_exported() {
+int libshared_and_static_exported(void) {
return 0;
}
-int libshared_and_static_deprecated() {
+int libshared_and_static_deprecated(void) {
return 0;
}
-int libshared_and_static_not_exported() {
+int libshared_and_static_not_exported(void) {
return 0;
}
-int libshared_and_static_excluded() {
+int libshared_and_static_excluded(void) {
return 0;
}
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h
index 6801e5f..4d7900b 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h
@@ -47,12 +47,12 @@ public:
#endif
-LIBSHARED_AND_STATIC_EXPORT int libshared_and_static_exported();
+LIBSHARED_AND_STATIC_EXPORT int libshared_and_static_exported(void);
-LIBSHARED_AND_STATIC_DEPRECATED_EXPORT int libshared_and_static_deprecated();
+LIBSHARED_AND_STATIC_DEPRECATED_EXPORT int libshared_and_static_deprecated(void);
-int libshared_and_static_not_exported();
+int libshared_and_static_not_exported(void);
-int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded();
+int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded(void);
#endif
diff --git a/Tests/Module/GenerateExportHeader/libshared/libshared.cpp b/Tests/Module/GenerateExportHeader/libshared/libshared.cpp
index bba46a0..14b5aa2 100644
--- a/Tests/Module/GenerateExportHeader/libshared/libshared.cpp
+++ b/Tests/Module/GenerateExportHeader/libshared/libshared.cpp
@@ -74,22 +74,22 @@ int LibsharedExcluded::libshared_excluded() const {
#endif
-int libshared() {
+int libshared(void) {
return 0;
}
-int libshared_exported() {
+int libshared_exported(void) {
return 0;
}
-int libshared_deprecated() {
+int libshared_deprecated(void) {
return 0;
}
-int libshared_not_exported() {
+int libshared_not_exported(void) {
return 0;
}
-int libshared_excluded() {
+int libshared_excluded(void) {
return 0;
}
diff --git a/Tests/Module/GenerateExportHeader/libshared/libshared.h b/Tests/Module/GenerateExportHeader/libshared/libshared.h
index 5e862d0..a1534c0 100644
--- a/Tests/Module/GenerateExportHeader/libshared/libshared.h
+++ b/Tests/Module/GenerateExportHeader/libshared/libshared.h
@@ -47,12 +47,12 @@ public:
#endif
-LIBSHARED_EXPORT int libshared_exported();
+LIBSHARED_EXPORT int libshared_exported(void);
-LIBSHARED_DEPRECATED_EXPORT int libshared_deprecated();
+LIBSHARED_DEPRECATED_EXPORT int libshared_deprecated(void);
-int libshared_not_exported();
+int libshared_not_exported(void);
-int LIBSHARED_NO_EXPORT libshared_excluded();
+int LIBSHARED_NO_EXPORT libshared_excluded(void);
#endif
diff --git a/Tests/Module/GenerateExportHeader/libstatic/libstatic.cpp b/Tests/Module/GenerateExportHeader/libstatic/libstatic.cpp
index 0710c3e..e1a110f 100644
--- a/Tests/Module/GenerateExportHeader/libstatic/libstatic.cpp
+++ b/Tests/Module/GenerateExportHeader/libstatic/libstatic.cpp
@@ -70,18 +70,18 @@ int LibstaticExcluded::libstatic_excluded() const {
return 0;
}
-int libstatic_exported() {
+int libstatic_exported(void) {
return 0;
}
-int libstatic_deprecated() {
+int libstatic_deprecated(void) {
return 0;
}
-int libstatic_not_exported() {
+int libstatic_not_exported(void) {
return 0;
}
-int libstatic_excluded() {
+int libstatic_excluded(void) {
return 0;
}
diff --git a/Tests/Module/GenerateExportHeader/libstatic/libstatic.h b/Tests/Module/GenerateExportHeader/libstatic/libstatic.h
index cc7a35b..a21e044 100644
--- a/Tests/Module/GenerateExportHeader/libstatic/libstatic.h
+++ b/Tests/Module/GenerateExportHeader/libstatic/libstatic.h
@@ -43,12 +43,12 @@ public:
int LIBSTATIC_NO_EXPORT libstatic_excluded() const;
};
-LIBSTATIC_EXPORT int libstatic_exported();
+LIBSTATIC_EXPORT int libstatic_exported(void);
-LIBSTATIC_DEPRECATED_EXPORT int libstatic_deprecated();
+LIBSTATIC_DEPRECATED_EXPORT int libstatic_deprecated(void);
-int libstatic_not_exported();
+int libstatic_not_exported(void);
-int LIBSTATIC_NO_EXPORT libstatic_excluded();
+int LIBSTATIC_NO_EXPORT libstatic_excluded(void);
#endif
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=471eacc5664fc6d2d9366e9073ff945f3a6920b7
commit 471eacc5664fc6d2d9366e9073ff945f3a6920b7
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jul 10 19:36:12 2012 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 16 20:03:58 2013 +0200
Wrap the use of classes in __cplusplus.
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.cpp b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.cpp
index 1e07273..909b06a 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.cpp
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.cpp
@@ -1,6 +1,8 @@
#include "libshared_and_static.h"
+#ifdef __cplusplus
+
int LibsharedAndStatic::libshared_and_static() const
{
return 0;
@@ -70,6 +72,8 @@ int LibsharedAndStaticExcluded::libshared_and_static_excluded() const {
return 0;
}
+#endif
+
int libshared_and_static() {
return 0;
}
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h
index 049bfe9..6801e5f 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.h
@@ -4,6 +4,8 @@
#include "libshared_and_static_export.h"
+#ifdef __cplusplus
+
class LIBSHARED_AND_STATIC_EXPORT LibsharedAndStatic {
public:
int libshared_and_static() const;
@@ -43,6 +45,8 @@ public:
int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded() const;
};
+#endif
+
LIBSHARED_AND_STATIC_EXPORT int libshared_and_static_exported();
LIBSHARED_AND_STATIC_DEPRECATED_EXPORT int libshared_and_static_deprecated();
diff --git a/Tests/Module/GenerateExportHeader/libshared/libshared.cpp b/Tests/Module/GenerateExportHeader/libshared/libshared.cpp
index d4041b3..bba46a0 100644
--- a/Tests/Module/GenerateExportHeader/libshared/libshared.cpp
+++ b/Tests/Module/GenerateExportHeader/libshared/libshared.cpp
@@ -1,6 +1,8 @@
#include "libshared.h"
+#ifdef __cplusplus
+
int Libshared::libshared() const
{
return 0;
@@ -70,6 +72,8 @@ int LibsharedExcluded::libshared_excluded() const {
return 0;
}
+#endif
+
int libshared() {
return 0;
}
diff --git a/Tests/Module/GenerateExportHeader/libshared/libshared.h b/Tests/Module/GenerateExportHeader/libshared/libshared.h
index 3d9bbff..5e862d0 100644
--- a/Tests/Module/GenerateExportHeader/libshared/libshared.h
+++ b/Tests/Module/GenerateExportHeader/libshared/libshared.h
@@ -4,6 +4,8 @@
#include "libshared_export.h"
+#ifdef __cplusplus
+
class LIBSHARED_EXPORT Libshared {
public:
int libshared() const;
@@ -43,6 +45,8 @@ public:
int LIBSHARED_NO_EXPORT libshared_excluded() const;
};
+#endif
+
LIBSHARED_EXPORT int libshared_exported();
LIBSHARED_DEPRECATED_EXPORT int libshared_deprecated();
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=481129b1780772acd0ec856ded9344508c8a76c2
commit 481129b1780772acd0ec856ded9344508c8a76c2
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 16 10:05:22 2012 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 16 20:03:58 2013 +0200
Add missing test for exported free-function.
diff --git a/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt b/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt
index a5804fc..2a97d8f 100644
--- a/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt
@@ -8,6 +8,7 @@ macro(shared_build_fail Source Message)
endmacro()
shared_build_pass("Libshared l; return l.libshared_exported();" "Failed to build exported")
+shared_build_pass("return libshared_exported();" "Failed to build exported function.")
# if (COMPILER_HAS_DEPRECATED)
# shared_build_fail("Libshared l; return l.libshared_deprecated();" "Built use of deprecated class method. This should not be possible.")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd5928cdcf48c07a49e70f11030e5cd7de62f9ad
commit fd5928cdcf48c07a49e70f11030e5cd7de62f9ad
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Jul 11 17:06:37 2012 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 16 20:03:58 2013 +0200
Add some newlines to separate the failure message compiler output.
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 4a5b1cb..454f37a 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -23,13 +23,13 @@ set( CMAKE_INCLUDE_CURRENT_DIR ON )
macro(TEST_FAIL value msg)
if (${value})
- message (SEND_ERROR "Test fail:" ${msg} ${Out} )
+ message (SEND_ERROR "Test fail:" "${msg}\n" ${Out} )
endif ()
endmacro()
macro(TEST_PASS value msg)
if (NOT ${value})
- message (SEND_ERROR "Test fail:" ${msg} ${Out} )
+ message (SEND_ERROR "Test fail:" "${msg}\n" ${Out} )
endif ()
endmacro()
-----------------------------------------------------------------------
Summary of changes:
Modules/GenerateExportHeader.cmake | 19 ++++++--
Tests/Module/GenerateExportHeader/CMakeLists.txt | 16 +++---
.../lib_shared_and_static/libshared_and_static.cpp | 14 ++++--
.../lib_shared_and_static/libshared_and_static.h | 12 +++--
.../lib_shared_and_statictest/CMakeLists.txt | 50 +++++++++++--------
.../GenerateExportHeader/libshared/libshared.cpp | 14 ++++--
.../GenerateExportHeader/libshared/libshared.h | 12 +++--
.../libsharedtest/CMakeLists.txt | 27 +++++++---
.../GenerateExportHeader/libstatic/libstatic.cpp | 8 ++--
.../GenerateExportHeader/libstatic/libstatic.h | 8 ++--
.../libstatictest/CMakeLists.txt | 4 +-
11 files changed, 115 insertions(+), 69 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list