[Cmake-commits] CMake branch, next, updated. v2.8.11-2142-g661059d

Stephen Kelly steveire at gmail.com
Wed May 22 09:52: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  661059dd0ed4ae3017c08244bdd62091afc2b808 (commit)
       via  d0c759621014df88d8e0d6ba75c6c28202966737 (commit)
      from  79ddd5f2a23ec938cd38b2c2ec43495744a3d29a (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=661059dd0ed4ae3017c08244bdd62091afc2b808
commit 661059dd0ed4ae3017c08244bdd62091afc2b808
Merge: 79ddd5f d0c7596
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed May 22 09:52:53 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed May 22 09:52:53 2013 -0400

    Merge topic 'generate_export_header-fixes' into next
    
    d0c7596 Revert the changes in the generate_export_header-fixes topic.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0c759621014df88d8e0d6ba75c6c28202966737
commit d0c759621014df88d8e0d6ba75c6c28202966737
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed May 22 14:44:03 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed May 22 14:44:24 2013 +0200

    Revert the changes in the generate_export_header-fixes topic.
    
    It is not ready to be merged to master.

diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index fdb5653..892ebc6 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -143,37 +143,11 @@
 #  License text for the above reference.)
 
 include(CMakeParseArguments)
-
-if (CMAKE_CXX_COMPILER_LOADED)
-  include(CheckCXXCompilerFlag)
-endif()
-
-if (CMAKE_C_COMPILER_LOADED)
-  include(CheckCCompilerFlag)
-endif()
-
-macro(_check_compiler_flag)
-  if (CMAKE_CXX_COMPILER_LOADED)
-      check_cxx_compiler_flag(${ARGN})
-  elseif(CMAKE_C_COMPILER_LOADED)
-      check_c_compiler_flag(${ARGN})
-  else()
-      message(FATAL_ERROR "This module requires at least a C or C++ compiler.")
-  endif()
-endmacro()
-macro(_check_source_compiles _CODE _RESULT)
-  if (CMAKE_CXX_COMPILER_LOADED)
-    check_cxx_source_compiles("${_CODE}" ${_RESULT})
-  elseif(CMAKE_C_COMPILER_LOADED)
-    check_c_source_compiles("${_CODE}" ${_RESULT})
-  else()
-      message(FATAL_ERROR "This module requires at least a C or C++ compiler.")
-  endif()
-endmacro()
+include(CheckCXXCompilerFlag)
 
 # TODO: Install this macro separately?
-macro(_check_compiler_attribute _ATTRIBUTE _RESULT)
-  _check_source_compiles("${_ATTRIBUTE} int somefunc() { return 0; }
+macro(_check_cxx_compiler_attribute _ATTRIBUTE _RESULT)
+  check_cxx_source_compiles("${_ATTRIBUTE} int somefunc() { return 0; }
     int main() { return somefunc();}" ${_RESULT}
   )
 endmacro()
@@ -198,8 +172,8 @@ macro(_test_compiler_hidden_visibility)
       AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES XL
       AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES PGI
       AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES Watcom)
-    _check_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
-    _check_compiler_flag(-fvisibility-inlines-hidden
+    check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY)
+    check_cxx_compiler_flag(-fvisibility-inlines-hidden
       COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
     option(USE_COMPILER_HIDDEN_VISIBILITY
       "Use HIDDEN visibility support if available." ON)
@@ -216,13 +190,13 @@ macro(_test_compiler_has_deprecated)
     set(COMPILER_HAS_DEPRECATED "" CACHE INTERNAL
       "Compiler support for a deprecated attribute")
   else()
-    _check_compiler_attribute("__attribute__((__deprecated__))"
+    _check_cxx_compiler_attribute("__attribute__((__deprecated__))"
       COMPILER_HAS_DEPRECATED_ATTR)
     if(COMPILER_HAS_DEPRECATED_ATTR)
       set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_ATTR}"
         CACHE INTERNAL "Compiler support for a deprecated attribute")
     else()
-      _check_compiler_attribute("__declspec(deprecated)"
+      _check_cxx_compiler_attribute("__declspec(deprecated)"
         COMPILER_HAS_DEPRECATED)
     endif()
   endif()
@@ -357,33 +331,17 @@ function(add_compiler_export_flags)
     return()
   endif()
 
-  set (EXTRA_FLAGS_C "-fvisibility=hidden")
-  set (EXTRA_FLAGS_CXX "-fvisibility=hidden")
+  set (EXTRA_FLAGS "-fvisibility=hidden")
 
   if(COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
-    set (EXTRA_FLAGS_CXX "${EXTRA_FLAGS_CXX} -fvisibility-inlines-hidden")
+    set (EXTRA_FLAGS "${EXTRA_FLAGS} -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)
-    if (NOT ("${ARGV0}" STREQUAL "CXX" OR "${ARGV0}" STREQUAL "C"))
-      set(${ARGV0} "${EXTRA_FLAGS_CXX}" PARENT_SCOPE)
-    else()
-      set(options)
-      set(oneValueArgs CXX C)
-      set(multiValueArgs)
-      cmake_parse_arguments(_CEF "${options}" "${oneValueArgs}" "${multiValueArgs}"
-          ${ARGN})
-      if (_CEF_CXX)
-        set(${_CEF_CXX} "${EXTRA_FLAGS_CXX}" PARENT_SCOPE)
-      endif()
-      if (_CEF_C)
-        set(${_CEF_C} "${EXTRA_FLAGS_C}" PARENT_SCOPE)
-      endif()
-    endif()
+    set(${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE)
   else()
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS_CXX}" PARENT_SCOPE)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS_C}" PARENT_SCOPE)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE)
   endif()
 endfunction()
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index f508ee8..4a5b1cb 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}\n" ${Out} )
+    message (SEND_ERROR "Test fail:" ${msg} ${Out} )
   endif ()
 endmacro()
 
 macro(TEST_PASS value msg)
   if (NOT ${value})
-    message (SEND_ERROR "Test fail:" "${msg}\n" ${Out} )
+    message (SEND_ERROR "Test fail:" ${msg} ${Out} )
   endif ()
 endmacro()
 
@@ -82,16 +82,13 @@ 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 Languages)
+macro(_do_build Include Library LibrarySource Source)
 
   math(EXPR COUNT "${COUNT} + 1" )
 
   file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/src.cpp" "#include \"${Include}\"\n"
     "int main() { ${Source}; }\n"
   )
-  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/src.c" "#include \"${Include}\"\n"
-    "int main() { ${Source}; }\n"
-  )
 
   if ("${Library}" STREQUAL "static_variant")
     set(CONDITIONAL_STATIC_DEFINE "add_definitions(-DLIBSHARED_AND_STATIC_STATIC_DEFINE)\n")
@@ -100,7 +97,7 @@ macro(_do_build Include Library LibrarySource Source Languages)
   file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test${COUNT}/CMakeLists.txt"
     "cmake_minimum_required(VERSION 2.8)\n"
 
-    "project(compiletest ${Languages})\n"
+    "project(compiletest)\n"
 
     "set(CMAKE_INCLUDE_CURRENT_DIR ON)\n"
 
@@ -121,13 +118,8 @@ macro(_do_build Include Library LibrarySource Source Languages)
 
     "${CONDITIONAL_STATIC_DEFINE}"
 
-    "if(CMAKE_CXX_COMPILER_LOADED)\n"
-    "  add_executable(compiletest src.cpp)\n"
-    "  target_link_libraries(compiletest ${Library})\n"
-    "elseif(CMAKE_C_COMPILER_LOADED)\n"
-    "  add_executable(compiletest src.c)\n"
-    "  target_link_libraries(compiletest ${Library}_c)\n"
-    "endif()\n"
+    "add_executable(compiletest src.cpp)\n"
+    "target_link_libraries(compiletest ${Library})\n"
   )
 
   try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/fail${COUNT}
@@ -137,13 +129,13 @@ macro(_do_build Include Library LibrarySource Source Languages)
   )
 endmacro()
 
-macro(build_fail Include Library LibrarySource Source Message Languages)
-  _do_build(${Include} ${Library} ${LibrarySource} "${Source}" "${Languages}")
+macro(build_fail Include Library LibrarySource Source Message)
+  _do_build(${Include} ${Library} ${LibrarySource} "${Source}")
   test_fail(Result ${Message})
 endmacro()
 
-macro(build_pass Include Library LibrarySource Source Message Languages)
-  _do_build(${Include} ${Library} ${LibrarySource} "${Source}" "${Languages}")
+macro(build_pass Include Library LibrarySource Source Message)
+  _do_build(${Include} ${Library} ${LibrarySource} "${Source}")
   test_pass(Result ${Message})
 endmacro()
 
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
index 21e1967..be0387f 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
@@ -9,25 +9,15 @@ add_compiler_export_flags()
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
-set(lib_SRCS_CXX
+set(lib_SRCS
   libshared_and_static.cpp
 )
 
-configure_file(libshared_and_static.cpp libshared_and_static.c COPYONLY)
-
-set(lib_SRCS_C
-  libshared_and_static.c
-)
-
-add_library(shared_variant SHARED ${lib_SRCS_CXX})
-add_library(static_variant ${lib_SRCS_CXX})
-add_library(shared_variant_c SHARED ${lib_SRCS_C})
-set_property(TARGET shared_variant_c PROPERTY DEFINE_SYMBOL shared_variant_EXPORTS)
-add_library(static_variant_c ${lib_SRCS_C})
+add_library(shared_variant SHARED ${lib_SRCS})
+add_library(static_variant ${lib_SRCS})
 
 generate_export_header(shared_variant BASE_NAME libshared_and_static)
 
 set_target_properties(static_variant PROPERTIES COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
-set_target_properties(static_variant_c PROPERTIES COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
 
-export(TARGETS shared_variant static_variant shared_variant_c static_variant_c FILE Targets.cmake)
+export(TARGETS shared_variant static_variant FILE Targets.cmake)
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 13c46bc..1e07273 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,8 +1,6 @@
 
 #include "libshared_and_static.h"
 
-#ifdef __cplusplus
-
 int LibsharedAndStatic::libshared_and_static() const
 {
   return 0;
@@ -72,24 +70,22 @@ int LibsharedAndStaticExcluded::libshared_and_static_excluded() const {
   return 0;
 }
 
-#endif
-
-int libshared_and_static(void) {
+int libshared_and_static() {
   return 0;
 }
 
-int libshared_and_static_exported(void) {
+int libshared_and_static_exported() {
   return 0;
 }
 
-int libshared_and_static_deprecated(void) {
+int libshared_and_static_deprecated() {
   return 0;
 }
 
-int libshared_and_static_not_exported(void) {
+int libshared_and_static_not_exported() {
   return 0;
 }
 
-int libshared_and_static_excluded(void) {
+int libshared_and_static_excluded() {
   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 4d7900b..049bfe9 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,8 +4,6 @@
 
 #include "libshared_and_static_export.h"
 
-#ifdef __cplusplus
-
 class LIBSHARED_AND_STATIC_EXPORT LibsharedAndStatic {
 public:
   int libshared_and_static() const;
@@ -45,14 +43,12 @@ public:
   int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded() const;
 };
 
-#endif
-
-LIBSHARED_AND_STATIC_EXPORT int libshared_and_static_exported(void);
+LIBSHARED_AND_STATIC_EXPORT int libshared_and_static_exported();
 
-LIBSHARED_AND_STATIC_DEPRECATED_EXPORT int libshared_and_static_deprecated(void);
+LIBSHARED_AND_STATIC_DEPRECATED_EXPORT int libshared_and_static_deprecated();
 
-int libshared_and_static_not_exported(void);
+int libshared_and_static_not_exported();
 
-int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded(void);
+int LIBSHARED_AND_STATIC_NO_EXPORT libshared_and_static_excluded();
 
 #endif
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_statictest/CMakeLists.txt b/Tests/Module/GenerateExportHeader/lib_shared_and_statictest/CMakeLists.txt
index d14195c..207534d 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_statictest/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_statictest/CMakeLists.txt
@@ -1,44 +1,33 @@
 
-macro(shared_variant_build_pass Source Message Languages)
-  build_pass("libshared_and_static.h" "shared_variant" "lib_shared_and_static" "${Source}" ${Message} "${Languages}")
+macro(shared_variant_build_pass Source Message)
+  build_pass("libshared_and_static.h" "shared_variant" "lib_shared_and_static" "${Source}" ${Message})
 endmacro()
 
 macro(shared_variant_build_fail Source Message)
-  build_fail("libshared_and_static.h" "shared_variant" "lib_shared_and_static" "${Source}" ${Message} "${Languages}")
+  build_fail("libshared_and_static.h" "shared_variant" "lib_shared_and_static" "${Source}" ${Message})
 endmacro()
 
 macro(static_variant_build_pass Source Message)
-  build_pass("libshared_and_static.h" "static_variant" "lib_shared_and_static" "${Source}" ${Message} "${Languages}")
+  build_pass("libshared_and_static.h" "static_variant" "lib_shared_and_static" "${Source}" ${Message})
 endmacro()
 
 macro(static_variant_build_fail Source Message)
-  build_fail("libshared_and_static.h" "static_variant" "lib_shared_and_static" "${Source}" ${Message} "${Languages}")
+  build_fail("libshared_and_static.h" "static_variant" "lib_shared_and_static" "${Source}" ${Message})
 endmacro()
 
-
-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")
-if(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES XL AND NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
-  run_tests("C")
+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()
-run_tests("C CXX")
diff --git a/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt b/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt
index 773d978..e20adb1 100644
--- a/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt
@@ -5,19 +5,12 @@ project(libshared)
 
 include(GenerateExportHeader)
 
-add_compiler_export_flags(CXX CXX_EXPORT_FLAGS C C_EXPORT_FLAGS)
+add_compiler_export_flags()
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 add_library(libshared SHARED libshared.cpp)
-set_property(TARGET libshared PROPERTY COMPILE_FLAGS ${CXX_EXPORT_FLAGS})
-
-configure_file(libshared.cpp libshared.c COPYONLY)
-
-add_library(libshared_c SHARED libshared.c)
-set_property(TARGET libshared_c PROPERTY DEFINE_SYMBOL libshared_EXPORTS)
-set_property(TARGET libshared_c PROPERTY COMPILE_FLAGS ${C_EXPORT_FLAGS})
 
 generate_export_header(libshared)
 
-export(TARGETS libshared libshared_c FILE Targets.cmake)
+export(TARGETS libshared FILE Targets.cmake)
diff --git a/Tests/Module/GenerateExportHeader/libshared/libshared.cpp b/Tests/Module/GenerateExportHeader/libshared/libshared.cpp
index 14b5aa2..d4041b3 100644
--- a/Tests/Module/GenerateExportHeader/libshared/libshared.cpp
+++ b/Tests/Module/GenerateExportHeader/libshared/libshared.cpp
@@ -1,8 +1,6 @@
 
 #include "libshared.h"
 
-#ifdef __cplusplus
-
 int Libshared::libshared() const
 {
   return 0;
@@ -72,24 +70,22 @@ int LibsharedExcluded::libshared_excluded() const {
   return 0;
 }
 
-#endif
-
-int libshared(void) {
+int libshared() {
   return 0;
 }
 
-int libshared_exported(void) {
+int libshared_exported() {
   return 0;
 }
 
-int libshared_deprecated(void) {
+int libshared_deprecated() {
   return 0;
 }
 
-int libshared_not_exported(void) {
+int libshared_not_exported() {
   return 0;
 }
 
-int libshared_excluded(void) {
+int libshared_excluded() {
   return 0;
 }
diff --git a/Tests/Module/GenerateExportHeader/libshared/libshared.h b/Tests/Module/GenerateExportHeader/libshared/libshared.h
index a1534c0..3d9bbff 100644
--- a/Tests/Module/GenerateExportHeader/libshared/libshared.h
+++ b/Tests/Module/GenerateExportHeader/libshared/libshared.h
@@ -4,8 +4,6 @@
 
 #include "libshared_export.h"
 
-#ifdef __cplusplus
-
 class LIBSHARED_EXPORT Libshared {
 public:
   int libshared() const;
@@ -45,14 +43,12 @@ public:
   int LIBSHARED_NO_EXPORT libshared_excluded() const;
 };
 
-#endif
-
-LIBSHARED_EXPORT int libshared_exported(void);
+LIBSHARED_EXPORT int libshared_exported();
 
-LIBSHARED_DEPRECATED_EXPORT int libshared_deprecated(void);
+LIBSHARED_DEPRECATED_EXPORT int libshared_deprecated();
 
-int libshared_not_exported(void);
+int libshared_not_exported();
 
-int LIBSHARED_NO_EXPORT libshared_excluded(void);
+int LIBSHARED_NO_EXPORT libshared_excluded();
 
 #endif
diff --git a/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt b/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt
index e6969ae..a5804fc 100644
--- a/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/libsharedtest/CMakeLists.txt
@@ -1,10 +1,10 @@
 
 macro(shared_build_pass Source Message)
-    build_pass("libshared.h" "libshared" "libshared" "${Source}" ${Message} "${ARGN}")
+    build_pass("libshared.h" "libshared" "libshared" "${Source}" ${Message})
 endmacro()
 
 macro(shared_build_fail Source Message)
-    build_fail("libshared.h" "libshared" "libshared" "${Source}" ${Message} "${ARGN}")
+    build_fail("libshared.h" "libshared" "libshared" "${Source}" ${Message})
 endmacro()
 
 shared_build_pass("Libshared l; return l.libshared_exported();" "Failed to build exported")
@@ -28,6 +28,9 @@ 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.")
@@ -35,24 +38,7 @@ 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.")
-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")
-if(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES XL AND NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
-    run_tests("C")
+  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()
-run_tests("C CXX")
diff --git a/Tests/Module/GenerateExportHeader/libstatic/libstatic.cpp b/Tests/Module/GenerateExportHeader/libstatic/libstatic.cpp
index e1a110f..0710c3e 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(void) {
+int libstatic_exported() {
   return 0;
 }
 
-int libstatic_deprecated(void) {
+int libstatic_deprecated() {
   return 0;
 }
 
-int libstatic_not_exported(void) {
+int libstatic_not_exported() {
   return 0;
 }
 
-int libstatic_excluded(void) {
+int libstatic_excluded() {
   return 0;
 }
diff --git a/Tests/Module/GenerateExportHeader/libstatic/libstatic.h b/Tests/Module/GenerateExportHeader/libstatic/libstatic.h
index a21e044..cc7a35b 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(void);
+LIBSTATIC_EXPORT int libstatic_exported();
 
-LIBSTATIC_DEPRECATED_EXPORT int libstatic_deprecated(void);
+LIBSTATIC_DEPRECATED_EXPORT int libstatic_deprecated();
 
-int libstatic_not_exported(void);
+int libstatic_not_exported();
 
-int LIBSTATIC_NO_EXPORT libstatic_excluded(void);
+int LIBSTATIC_NO_EXPORT libstatic_excluded();
 
 #endif
diff --git a/Tests/Module/GenerateExportHeader/libstatictest/CMakeLists.txt b/Tests/Module/GenerateExportHeader/libstatictest/CMakeLists.txt
index 15771f3..eb6bb87 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.")

-----------------------------------------------------------------------

Summary of changes:
 Modules/GenerateExportHeader.cmake                 |   64 ++++----------------
 Tests/Module/GenerateExportHeader/CMakeLists.txt   |   28 +++------
 .../lib_shared_and_static/CMakeLists.txt           |   18 +----
 .../lib_shared_and_static/libshared_and_static.cpp |   14 ++---
 .../lib_shared_and_static/libshared_and_static.h   |   12 +---
 .../lib_shared_and_statictest/CMakeLists.txt       |   51 ++++++----------
 .../GenerateExportHeader/libshared/CMakeLists.txt  |   11 +---
 .../GenerateExportHeader/libshared/libshared.cpp   |   14 ++---
 .../GenerateExportHeader/libshared/libshared.h     |   12 +---
 .../libsharedtest/CMakeLists.txt                   |   28 ++-------
 .../GenerateExportHeader/libstatic/libstatic.cpp   |    8 +-
 .../GenerateExportHeader/libstatic/libstatic.h     |    8 +-
 .../libstatictest/CMakeLists.txt                   |    4 +-
 13 files changed, 82 insertions(+), 190 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list