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, master has been updated via 3cb12895f3d99614ac30bd2f7703f721154b7068 (commit) via c54448e1855432de95844d4d0546bbe6d7f47c84 (commit) from a29b8d285e176b40c9c5f1ce506dd97ed38f9c97 (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 ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3cb12895f3d99614ac30bd2f7703f721154b7068 commit 3cb12895f3d99614ac30bd2f7703f721154b7068 Merge: a29b8d2 c54448e Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Sep 26 13:51:41 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Thu Sep 26 09:51:55 2019 -0400 Merge topic 'pch-export' c54448e185 PCH: Propagate INTERFACE_PRECOMPILE_HEADERS in install(EXPORT) Acked-by: Kitware Robot <kwro...@kitware.com> Acked-by: Cristian Adam <cristian.a...@gmail.com> Merge-request: !3862 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c54448e1855432de95844d4d0546bbe6d7f47c84 commit c54448e1855432de95844d4d0546bbe6d7f47c84 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Sep 23 13:51:07 2019 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed Sep 25 12:06:28 2019 -0400 PCH: Propagate INTERFACE_PRECOMPILE_HEADERS in install(EXPORT) This was accidentally left out of commit 0467a2f91b (PCH: add PRECOMPILE_HEADERS to special properties, 2015-03-12). Also add a test case for `install(EXPORT)` and `export()` propagation of precompiled headers. Fixes: #19741 diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 0009b3a..1e843b6 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -94,6 +94,9 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS", gt, cmGeneratorExpression::InstallInterface, properties, missingTargets); + this->PopulateInterfaceProperty("INTERFACE_PRECOMPILE_HEADERS", gt, + cmGeneratorExpression::InstallInterface, + properties, missingTargets); this->PopulateInterfaceProperty("INTERFACE_AUTOUIC_OPTIONS", gt, cmGeneratorExpression::InstallInterface, properties, missingTargets); diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt index 22a4ef6..43b7217 100644 --- a/Tests/ExportImport/Export/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt @@ -6,6 +6,12 @@ set_property(TARGET headeronly PROPERTY INTERFACE_INCLUDE_DIRECTORIES ) set_property(TARGET headeronly PROPERTY INTERFACE_COMPILE_DEFINITIONS "HEADERONLY_DEFINE") +add_library(pch_iface INTERFACE) +target_precompile_headers(pch_iface INTERFACE + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pch/pch.h>" + "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/pch/pch.h>" + ) + include(GenerateExportHeader) add_library(sharedlib SHARED sharedlib.cpp) generate_export_header(sharedlib) @@ -45,7 +51,7 @@ set_property(TARGET cmakeonly PROPERTY custom_property CustomPropertyValue) set_property(TARGET cmakeonly PROPERTY EXPORT_PROPERTIES custom_property) install(TARGETS headeronly sharediface use_auto_type use_c_restrict source_target - cmakeonly + pch_iface cmakeonly EXPORT expInterface ) install(TARGETS sharedlib @@ -61,6 +67,10 @@ install(FILES DESTINATION include/headeronly ) install(FILES + pch/pch.h + DESTINATION include/pch +) +install(FILES sharedlib/sharedlib.h "${CMAKE_CURRENT_BINARY_DIR}/sharedlib_export.h" DESTINATION include/sharedlib diff --git a/Tests/ExportImport/Export/Interface/pch/pch.h b/Tests/ExportImport/Export/Interface/pch/pch.h new file mode 100644 index 0000000..bc50727 --- /dev/null +++ b/Tests/ExportImport/Export/Interface/pch/pch.h @@ -0,0 +1 @@ +#define PCH_PCH_H_INCLUDED diff --git a/Tests/ExportImport/Import/Interface/CMakeLists.txt b/Tests/ExportImport/Import/Interface/CMakeLists.txt index a07a5b3..ef666b1 100644 --- a/Tests/ExportImport/Import/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Import/Interface/CMakeLists.txt @@ -98,6 +98,17 @@ set_property(TARGET exp::sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES de add_executable(interfacetest_exp interfacetest.cpp) target_link_libraries(interfacetest_exp exp::sharediface) +if(NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]" OR CMAKE_GENERATOR STREQUAL "Xcode") + add_executable(pch_iface_test_bld pch_iface_test.cpp) + target_link_libraries(pch_iface_test_bld bld::pch_iface) + add_executable(pch_iface_test_exp pch_iface_test.cpp) + target_link_libraries(pch_iface_test_exp exp::pch_iface) + if(CMAKE_CXX_COMPILE_OPTIONS_USE_PCH) + target_compile_definitions(pch_iface_test_bld PRIVATE EXPECT_PCH) + target_compile_definitions(pch_iface_test_exp PRIVATE EXPECT_PCH) + endif() +endif() + do_try_compile(exp) foreach(ns exp bld) diff --git a/Tests/ExportImport/Import/Interface/pch_iface_test.cpp b/Tests/ExportImport/Import/Interface/pch_iface_test.cpp new file mode 100644 index 0000000..a460d0d --- /dev/null +++ b/Tests/ExportImport/Import/Interface/pch_iface_test.cpp @@ -0,0 +1,16 @@ +#ifdef EXPECT_PCH +// Verify that pch/pch.h was included via '-include ...' or equivalent. +# ifndef PCH_PCH_H_INCLUDED +# error "Expected PCH_PCH_H_INCLUDED." +# endif +#elif defined(__PGIC__) || defined(__ibmxl__) +// No PCH expected but these compilers define macros below. +#elif defined(__GNUC__) || defined(__clang__) || defined(_INTEL_COMPILER) || \ + defined(_MSC_VER) +# error "Expected EXPECT_PCH for this compiler." +#endif + +int main() +{ + return 0; +} ----------------------------------------------------------------------- Summary of changes: Source/cmExportInstallFileGenerator.cxx | 3 +++ Tests/ExportImport/Export/Interface/CMakeLists.txt | 12 +++++++++++- Tests/ExportImport/Export/Interface/pch/pch.h | 1 + Tests/ExportImport/Import/Interface/CMakeLists.txt | 11 +++++++++++ Tests/ExportImport/Import/Interface/pch_iface_test.cpp | 16 ++++++++++++++++ 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Tests/ExportImport/Export/Interface/pch/pch.h create mode 100644 Tests/ExportImport/Import/Interface/pch_iface_test.cpp hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits