[Cmake-commits] CMake branch, next, updated. v2.8.11-2236-g0bd5a45

Stephen Kelly steveire at gmail.com
Mon May 27 19:23:04 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  0bd5a450c3520855d35e9334e900cd23edef7ce2 (commit)
       via  546e3160433003009c746df9ba09ee4c4a255130 (commit)
       via  d180a0ece93f2a66c78bed4df05a9d7fe6635e8b (commit)
      from  dbe762ed85efd857a6b9d64d1556247f2a899ee7 (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=0bd5a450c3520855d35e9334e900cd23edef7ce2
commit 0bd5a450c3520855d35e9334e900cd23edef7ce2
Merge: dbe762e 546e316
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon May 27 19:22:58 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon May 27 19:22:58 2013 -0400

    Merge topic 'VISIBILITY_PREFIX-property' into next
    
    546e316 Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.
    d180a0e Introduce target property <LANG>_VISIBILITY_PRESET


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=546e3160433003009c746df9ba09ee4c4a255130
commit 546e3160433003009c746df9ba09ee4c4a255130
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu May 23 15:32:17 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 23 15:54:48 2013 +0200

    Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.
    
    This corresponds to the g++ and clang++
    option -fvisibility-inlines-hidden on linux. On Windows with MinGW,
    this corresponds to -fno-keep-inline-dllexport. That option is
    not supported by clang currently.

diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 486e2af..972d889 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -1,2 +1,4 @@
 include(Compiler/Clang)
 __compiler_clang(CXX)
+
+set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 879ab8f..9bee962 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -1,2 +1,8 @@
 include(Compiler/GNU)
 __compiler_gnu(CXX)
+
+if (WIN32)
+  set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport")
+else()
+  set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
+endif()
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 71dd3e9..dce1838 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1992,28 +1992,12 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags,
     }
 }
 
-//----------------------------------------------------------------------------
-void cmLocalGenerator
-::AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
-                            const char *lang)
+static void AddVisibilityCompileOption(std::string &flags, cmTarget* target,
+                                       cmLocalGenerator *lg, const char *lang)
 {
-  int targetType = target->GetType();
-  bool suitableTarget = ((targetType == cmTarget::SHARED_LIBRARY)
-                      || (targetType == cmTarget::MODULE_LIBRARY)
-                      || (target->IsExecutableWithExports()));
-
-  if (!suitableTarget)
-    {
-    return;
-    }
-
-  if (!lang)
-    {
-    return;
-    }
   std::string l(lang);
   std::string compileOption = "CMAKE_" + l + "_COMPILE_OPTIONS_VISIBILITY";
-  const char *opt = this->Makefile->GetDefinition(compileOption.c_str());
+  const char *opt = lg->GetMakefile()->GetDefinition(compileOption.c_str());
   if (!opt)
     {
     return;
@@ -2037,7 +2021,50 @@ void cmLocalGenerator
     return;
     }
   std::string option = std::string(opt) + prop;
-  this->AppendFlags(flags, option.c_str());
+  lg->AppendFlags(flags, option.c_str());
+}
+
+static void AddInlineVisibilityCompileOption(std::string &flags,
+                                       cmTarget* target,
+                                       cmLocalGenerator *lg)
+{
+  std::string compileOption
+                = "CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN";
+  const char *opt = lg->GetMakefile()->GetDefinition(compileOption.c_str());
+  if (!opt)
+    {
+    return;
+    }
+
+  bool prop = target->GetPropertyAsBool("VISIBILITY_INLINES_HIDDEN");
+  if (!prop)
+    {
+    return;
+    }
+  lg->AppendFlags(flags, opt);
+}
+
+//----------------------------------------------------------------------------
+void cmLocalGenerator
+::AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
+                            const char *lang)
+{
+  int targetType = target->GetType();
+  bool suitableTarget = ((targetType == cmTarget::SHARED_LIBRARY)
+                      || (targetType == cmTarget::MODULE_LIBRARY)
+                      || (target->IsExecutableWithExports()));
+
+  if (!suitableTarget)
+    {
+    return;
+    }
+
+  if (!lang)
+    {
+    return;
+    }
+  AddVisibilityCompileOption(flags, target, this, lang);
+  AddInlineVisibilityCompileOption(flags, target, this);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 7712a58..21c7323 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -143,8 +143,7 @@ public:
                         const char* config);
   void AddCMP0018Flags(std::string &flags, cmTarget* target,
                        std::string const& lang, const char *config);
-  void AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
-                                 const char *lang);
+  void AddVisibilityPresetFlags(std::string &flags, cmTarget* target);
   void AddConfigVariableFlags(std::string& flags, const char* var,
                               const char* config);
   ///! Append flags to a string.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c34c3ab..47e36fd 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -942,6 +942,17 @@ void cmTarget::DefineProperties(cmake *cm)
      "CMAKE_CXX_VISIBILITY_PRESET if it is set when a target is created.");
 
   cm->DefineProperty
+    ("VISIBILITY_INLINES_HIDDEN", cmProperty::TARGET,
+     "Whether to add a compile flag to hide symbols of inline functions",
+     "The VISIBILITY_INLINES_HIDDEN property determines whether a flag for "
+     "hiding symbols for inline functions. the value passed used in "
+     "a visibility related compile option, such as -fvisibility=.  This "
+     "property only has an affect for libraries and executables with "
+     "exports.  This property is initialized by the value of the variable "
+     "CMAKE_VISIBILITY_INLINES_HIDDEN if it is set when a target is "
+     "created.");
+
+  cm->DefineProperty
     ("POSITION_INDEPENDENT_CODE", cmProperty::TARGET,
      "Whether to create a position-independent target",
      "The POSITION_INDEPENDENT_CODE property determines whether position "
@@ -1580,6 +1591,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
 
   this->SetPropertyDefault("C_VISIBILITY_PRESET", 0);
   this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0);
+  this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", 0);
 
   if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY
       || this->TargetTypeValue == cmTarget::MODULE_LIBRARY)
diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt b/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt
index ffa9380..2571d22 100644
--- a/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt
@@ -1,9 +1,13 @@
 
 set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
 
 if (CMAKE_CXX_FLAGS MATCHES "-fvisibility=hidden")
   message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory")
 endif()
+if (CMAKE_CXX_FLAGS MATCHES "-fvisibility-inlines-hidden")
+  message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory")
+endif()
 
 add_library(visibility_preset SHARED visibility_preset.cpp)
 generate_export_header(visibility_preset)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d180a0ece93f2a66c78bed4df05a9d7fe6635e8b
commit d180a0ece93f2a66c78bed4df05a9d7fe6635e8b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 18 12:12:18 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu May 23 15:50:22 2013 +0200

    Introduce target property <LANG>_VISIBILITY_PRESET
    
    This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target
    property is used as the operand to the -fvisibility= compile option
    with GNU compilers and clang.

diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index faad416..504704d 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -25,6 +25,9 @@ macro(__compiler_gnu lang)
   if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4)
     set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
   endif()
+  if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.2)
+    set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
+  endif()
   set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
   set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
 
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index e23317c..187f350 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -6,5 +6,9 @@ set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
 set(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
 
+if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0)
+  set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
+endif()
+
 set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
 set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index ae6021a..c7b40a4 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -6,5 +6,9 @@ set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
 set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
 
+if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0)
+  set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
+endif()
+
 set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
 set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d346f16..71dd3e9 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1993,6 +1993,54 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags,
 }
 
 //----------------------------------------------------------------------------
+void cmLocalGenerator
+::AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
+                            const char *lang)
+{
+  int targetType = target->GetType();
+  bool suitableTarget = ((targetType == cmTarget::SHARED_LIBRARY)
+                      || (targetType == cmTarget::MODULE_LIBRARY)
+                      || (target->IsExecutableWithExports()));
+
+  if (!suitableTarget)
+    {
+    return;
+    }
+
+  if (!lang)
+    {
+    return;
+    }
+  std::string l(lang);
+  std::string compileOption = "CMAKE_" + l + "_COMPILE_OPTIONS_VISIBILITY";
+  const char *opt = this->Makefile->GetDefinition(compileOption.c_str());
+  if (!opt)
+    {
+    return;
+    }
+  std::string flagDefine = l + "_VISIBILITY_PRESET";
+
+  const char *prop = target->GetProperty(flagDefine.c_str());
+  if (!prop)
+    {
+    return;
+    }
+  if (strcmp(prop, "hidden") != 0
+      && strcmp(prop, "default") != 0
+      && strcmp(prop, "protected") != 0
+      && strcmp(prop, "internal") != 0 )
+    {
+    cmOStringStream e;
+    e << "Target " << target->GetName() << " uses unsupported value \""
+      << prop << "\" for " << flagDefine << ".";
+    cmSystemTools::Error(e.str().c_str());
+    return;
+    }
+  std::string option = std::string(opt) + prop;
+  this->AppendFlags(flags, option.c_str());
+}
+
+//----------------------------------------------------------------------------
 void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target,
                                        std::string const& lang,
                                        const char *config)
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index a1c34f0..7712a58 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -143,6 +143,8 @@ public:
                         const char* config);
   void AddCMP0018Flags(std::string &flags, cmTarget* target,
                        std::string const& lang, const char *config);
+  void AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
+                                 const char *lang);
   void AddConfigVariableFlags(std::string& flags, const char* var,
                               const char* config);
   ///! Append flags to a string.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 4220ae1..a7be669 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -271,6 +271,9 @@ std::string cmMakefileTargetGenerator::GetFlags(const std::string &l)
     this->LocalGenerator->AddCMP0018Flags(flags, this->Target,
                                           lang, this->ConfigName);
 
+    this->LocalGenerator->AddVisibilityPresetFlags(flags, this->Target,
+                                                   lang);
+
     // Add include directory flags.
     this->AddIncludeFlags(flags, lang);
 
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 850e5ea..778f86a 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -150,6 +150,9 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source,
                                         language.c_str(),
                                         this->GetConfigName());
 
+  this->LocalGenerator->AddVisibilityPresetFlags(flags, this->Target,
+                                                 language.c_str());
+
   // Add include directory flags.
   {
   std::vector<std::string> includes;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index eb746b1..c34c3ab 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -924,6 +924,24 @@ void cmTarget::DefineProperties(cmake *cm)
      "(such as \"lib\") on a library name.");
 
   cm->DefineProperty
+    ("C_VISIBILITY_PRESET", cmProperty::TARGET,
+     "Value for symbol visibility compile flags",
+     "The C_VISIBILITY_PRESET property determines the value passed used in "
+     "a visibility related compile option, such as -fvisibility=.  This "
+     "property only has an affect for libraries and executables with "
+     "exports.  This property is initialized by the value of the variable "
+     "CMAKE_C_VISIBILITY_PRESET if it is set when a target is created.");
+
+  cm->DefineProperty
+    ("CXX_VISIBILITY_PRESET", cmProperty::TARGET,
+     "Value for symbol visibility compile flags",
+     "The CXX_VISIBILITY_PRESET property determines the value passed used in "
+     "a visibility related compile option, such as -fvisibility=.  This "
+     "property only has an affect for libraries and executables with "
+     "exports.  This property is initialized by the value of the variable "
+     "CMAKE_CXX_VISIBILITY_PRESET if it is set when a target is created.");
+
+  cm->DefineProperty
     ("POSITION_INDEPENDENT_CODE", cmProperty::TARGET,
      "Whether to create a position-independent target",
      "The POSITION_INDEPENDENT_CODE property determines whether position "
@@ -1560,6 +1578,9 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     this->InsertInclude(*it);
     }
 
+  this->SetPropertyDefault("C_VISIBILITY_PRESET", 0);
+  this->SetPropertyDefault("CXX_VISIBILITY_PRESET", 0);
+
   if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY
       || this->TargetTypeValue == cmTarget::MODULE_LIBRARY)
     {
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 4a5b1cb..359a1e3 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -141,6 +141,8 @@ endmacro()
 
 include(GenerateExportHeader)
 
+add_subdirectory(visibility_preset)
+
 add_compiler_export_flags()
 
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt b/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt
new file mode 100644
index 0000000..ffa9380
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt
@@ -0,0 +1,13 @@
+
+set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+
+if (CMAKE_CXX_FLAGS MATCHES "-fvisibility=hidden")
+  message(SEND_ERROR "Do not use add_compiler_export_flags before adding this directory")
+endif()
+
+add_library(visibility_preset SHARED visibility_preset.cpp)
+generate_export_header(visibility_preset)
+
+add_executable(visibility_preset_exe main.cpp)
+
+target_link_libraries(visibility_preset_exe visibility_preset)
diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/main.cpp b/Tests/Module/GenerateExportHeader/visibility_preset/main.cpp
new file mode 100644
index 0000000..89c3977
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/visibility_preset/main.cpp
@@ -0,0 +1,9 @@
+
+#include "visibility_preset.h"
+
+int main()
+{
+  VisibilityPreset vp;
+  vp.someMethod();
+  return 0;
+}
diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp
new file mode 100644
index 0000000..c97dec6
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp
@@ -0,0 +1,7 @@
+
+#include "visibility_preset.h"
+
+void VisibilityPreset::someMethod()
+{
+
+}
diff --git a/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h
new file mode 100644
index 0000000..8becbe1
--- /dev/null
+++ b/Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h
@@ -0,0 +1,13 @@
+
+#ifndef VISIBILITY_PRESET_H
+#define VISIBILITY_PRESET_H
+
+#include "visibility_preset_export.h"
+
+class VISIBILITY_PRESET_EXPORT VisibilityPreset
+{
+public:
+  void someMethod();
+};
+
+#endif
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index f676107..7a256a9 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -65,6 +65,7 @@ add_RunCMake_test(Languages)
 add_RunCMake_test(ObjectLibrary)
 if(NOT WIN32)
   add_RunCMake_test(PositionIndependentCode)
+  add_RunCMake_test(PresetVisibility)
 endif()
 add_RunCMake_test(CompatibleInterface)
 
diff --git a/Tests/RunCMake/VisibilityPreset/CMakeLists.txt b/Tests/RunCMake/VisibilityPreset/CMakeLists.txt
new file mode 100644
index 0000000..22577da
--- /dev/null
+++ b/Tests/RunCMake/VisibilityPreset/CMakeLists.txt
@@ -0,0 +1,8 @@
+
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} CXX)
+
+# MSVC creates extra targets which pollute the stderr unless we set this.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt b/Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt b/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt
new file mode 100644
index 0000000..ca8c33f
--- /dev/null
+++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Target visibility_preset uses unsupported value \"hiden\" for CXX_VISIBILITY_PRESET
diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake b/Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake
new file mode 100644
index 0000000..03c0ed9
--- /dev/null
+++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake
@@ -0,0 +1,3 @@
+
+add_library(visibility_preset SHARED lib.cpp)
+set_property(TARGET visibility_preset PROPERTY CXX_VISIBILITY_PRESET hiden)
diff --git a/Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake b/Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake
new file mode 100644
index 0000000..2d78832
--- /dev/null
+++ b/Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(PropertyTypo)
diff --git a/Tests/RunCMake/VisibilityPreset/lib.cpp b/Tests/RunCMake/VisibilityPreset/lib.cpp
new file mode 100644
index 0000000..06b3472
--- /dev/null
+++ b/Tests/RunCMake/VisibilityPreset/lib.cpp
@@ -0,0 +1,5 @@
+
+int foo(void)
+{
+  return 42;
+}

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

Summary of changes:
 Modules/Compiler/Clang-CXX.cmake                   |    2 +
 Modules/Compiler/GNU-CXX.cmake                     |    6 ++
 Modules/Compiler/GNU.cmake                         |    3 +
 Modules/Compiler/Intel-C.cmake                     |    4 +
 Modules/Compiler/Intel-CXX.cmake                   |    4 +
 Source/cmLocalGenerator.cxx                        |   75 ++++++++++++++++++++
 Source/cmLocalGenerator.h                          |    1 +
 Source/cmMakefileTargetGenerator.cxx               |    3 +
 Source/cmNinjaTargetGenerator.cxx                  |    3 +
 Source/cmTarget.cxx                                |   33 +++++++++
 Tests/Module/GenerateExportHeader/CMakeLists.txt   |    2 +
 .../visibility_preset/CMakeLists.txt               |   17 +++++
 .../visibility_preset/main.cpp                     |    9 +++
 .../visibility_preset/visibility_preset.cpp        |    7 ++
 .../visibility_preset/visibility_preset.h          |   13 ++++
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../CMakeLists.txt                                 |    0
 .../PropertyTypo-result.txt}                       |    0
 .../VisibilityPreset/PropertyTypo-stderr.txt       |    1 +
 Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake |    3 +
 Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake |    3 +
 .../foo.c => RunCMake/VisibilityPreset/lib.cpp}    |    3 +-
 22 files changed, 192 insertions(+), 1 deletions(-)
 create mode 100644 Tests/Module/GenerateExportHeader/visibility_preset/CMakeLists.txt
 create mode 100644 Tests/Module/GenerateExportHeader/visibility_preset/main.cpp
 create mode 100644 Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.cpp
 create mode 100644 Tests/Module/GenerateExportHeader/visibility_preset/visibility_preset.h
 copy Tests/RunCMake/{PositionIndependentCode => VisibilityPreset}/CMakeLists.txt (100%)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => VisibilityPreset/PropertyTypo-result.txt} (100%)
 create mode 100644 Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt
 create mode 100644 Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake
 create mode 100644 Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake
 copy Tests/{SourceGroups/sub1/foo.c => RunCMake/VisibilityPreset/lib.cpp} (56%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list