[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1589-g39b62a9
Stephen Kelly
steveire at gmail.com
Sun Jan 13 04:23:21 EST 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 39b62a93978dfec10c05e1531e790c427526bdaa (commit)
via 5693ae55946c0ab45615d0652ed6ce22ee60b9a1 (commit)
via 71d7bf80d38c5b09ff0ac16afcec2ebe7a44e47c (commit)
from c79877fe6cecd8755f8e624e3535271ea4764f51 (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=39b62a93978dfec10c05e1531e790c427526bdaa
commit 39b62a93978dfec10c05e1531e790c427526bdaa
Merge: c79877f 5693ae5
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 13 04:23:20 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jan 13 04:23:20 2013 -0500
Merge topic 'test-export-iface-genex' into next
5693ae5 Test evaluation target via export for generator expressions
71d7bf8 Export the INTERFACE_PIC property.
diff --cc Source/cmExportFileGenerator.cxx
index 4a7c6f9,6b2934a..61c99dd
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@@ -122,13 -121,13 +122,25 @@@ void cmExportFileGenerator::GenerateImp
}
// Generate the per-config target information.
- this->GenerateImportTargetsConfig(os, config, suffix);
+ this->GenerateImportTargetsConfig(os, config, suffix, missingTargets);
+}
+
+//----------------------------------------------------------------------------
+void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
+ cmTarget *target,
+ ImportPropertyMap &properties)
++{
++ const char *input = target->GetProperty(propName);
++ if (input)
++ {
++ properties[propName] = input;
++ }
+ }
+
+ //----------------------------------------------------------------------------
+ void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
+ cmTarget *target,
+ ImportPropertyMap &properties)
{
const char *input = target->GetProperty(propName);
if (input)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5693ae55946c0ab45615d0652ed6ce22ee60b9a1
commit 5693ae55946c0ab45615d0652ed6ce22ee60b9a1
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 12 12:13:44 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 13 10:22:48 2013 +0100
Test evaluation target via export for generator expressions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index fd7a1a6..dd615d1 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -186,7 +186,7 @@ set_property(TARGET testSharedLibDepends APPEND PROPERTY
)
set_property(TARGET testSharedLibDepends APPEND PROPERTY
LINK_INTERFACE_LIBRARIES
- $<1:$<TARGET_NAME:testSharedLibRequired>>
+ $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:$<TARGET_NAME:testSharedLibRequired>>
)
# LINK_PRIVATE because the LINK_INTERFACE_LIBRARIES is specified above.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=71d7bf80d38c5b09ff0ac16afcec2ebe7a44e47c
commit 71d7bf80d38c5b09ff0ac16afcec2ebe7a44e47c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 12 12:13:19 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 13 10:22:48 2013 +0100
Export the INTERFACE_PIC property.
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index cfd2c0b..cacdca6 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -72,6 +72,8 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS", te,
cmGeneratorExpression::BuildInterface,
properties, missingTargets);
+ this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
+ te, properties);
this->GenerateInterfaceProperties(te, os, properties);
}
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 94e24c7..6b2934a 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -126,6 +126,18 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
//----------------------------------------------------------------------------
void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
+ cmTarget *target,
+ ImportPropertyMap &properties)
+{
+ const char *input = target->GetProperty(propName);
+ if (input)
+ {
+ properties[propName] = input;
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
const char *outputName,
cmTarget *target,
cmGeneratorExpression::PreprocessContext preprocessRule,
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 4d97a63..476462d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -99,6 +99,8 @@ protected:
cmGeneratorExpression::PreprocessContext,
ImportPropertyMap &properties,
std::vector<std::string> &missingTargets);
+ void PopulateInterfaceProperty(const char *propName, cmTarget *target,
+ ImportPropertyMap &properties);
void GenerateInterfaceProperties(cmTarget *target, std::ostream& os,
const ImportPropertyMap &properties);
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 68881a1..2992d79 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -89,6 +89,8 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
te,
cmGeneratorExpression::InstallInterface,
properties, missingTargets);
+ this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
+ te, properties);
this->GenerateInterfaceProperties(te, os, properties);
}
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index e92dcd8..fd7a1a6 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -162,6 +162,10 @@ include(GenerateExportHeader)
add_library(testSharedLibRequired SHARED testSharedLibRequired.cpp)
generate_export_header(testSharedLibRequired)
+set_property(TARGET testSharedLibRequired
+ PROPERTY
+ INTERFACE_POSITION_INDEPENDENT_CODE ON
+)
set_property(TARGET testSharedLibRequired APPEND PROPERTY
INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}"
)
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 72d11b6..4812e7e 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -167,6 +167,24 @@ target_link_libraries(deps_shared_iface testSharedLibDepends)
target_include_directories(deps_shared_iface PRIVATE testSharedLibDepends)
target_compile_definitions(deps_shared_iface PRIVATE testSharedLibDepends)
+if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ include(CheckCXXCompilerFlag)
+ check_cxx_compiler_flag(-fPIE run_pic_test)
+else()
+ if (CMAKE_CXX_COMPILER_ID MATCHES "PGI"
+ OR CMAKE_CXX_COMPILER_ID MATCHES "PathScale"
+ OR CMAKE_SYSTEM_NAME MATCHES "IRIX64"
+ OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ set(run_pic_test 0)
+ else()
+ set(run_pic_test 1)
+ endif()
+endif()
+
+if (run_pic_test)
+ target_compile_definitions(deps_shared_iface PRIVATE CHECK_PIC_WORKS)
+endif()
+
#-----------------------------------------------------------------------------
# Test that targets imported from the build tree have their dependencies
# evaluated correctly. The above already tests the same for the install tree.
diff --git a/Tests/ExportImport/Import/A/deps_shared_iface.cpp b/Tests/ExportImport/Import/A/deps_shared_iface.cpp
index 14aac0a..43f832a 100644
--- a/Tests/ExportImport/Import/A/deps_shared_iface.cpp
+++ b/Tests/ExportImport/Import/A/deps_shared_iface.cpp
@@ -2,6 +2,12 @@
#include "testSharedLibDepends.h"
+#ifdef CHECK_PIC_WORKS
+#if defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__)
+#error Expected by INTERFACE_POSITION_INDEPENDENT_CODE property of dependency
+#endif
+#endif
+
#ifdef TEST_SUBDIR_LIB
#include "subdir.h"
#endif
-----------------------------------------------------------------------
Summary of changes:
Source/cmExportFileGenerator.cxx | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list