summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/3.6.rst5
-rw-r--r--Help/release/dev/GenerateExportHeader-custom-content.rst6
-rw-r--r--Modules/GenerateExportHeader.cmake17
-rw-r--r--Modules/exportheader.cmake.in2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/Checks/cm_cxx_override.cxx2
-rw-r--r--Source/cmCoreTryCompile.cxx8
-rw-r--r--Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt3
-rw-r--r--Tests/Module/GenerateExportHeader/lib_shared_and_static/libshared_and_static.cpp4
-rw-r--r--Tests/RunCMake/try_compile/CompileFlags.cmake17
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/try_compile/src.c3
-rw-r--r--Utilities/cmliblzma/CMakeLists.txt6
13 files changed, 32 insertions, 44 deletions
diff --git a/Help/release/3.6.rst b/Help/release/3.6.rst
index 5c08b39..771c9dd 100644
--- a/Help/release/3.6.rst
+++ b/Help/release/3.6.rst
@@ -42,11 +42,6 @@ Commands
commands gained support for the ``%s`` placeholder. This is
the number of seconds since the UNIX Epoch.
-* The :command:`try_compile` command source file signature now honors
- configuration-specific flags (e.g. :variable:`CMAKE_<LANG>_FLAGS_DEBUG`)
- in the generated test project. Previously only the default such flags
- for the current toolchain were used.
-
Variables
---------
diff --git a/Help/release/dev/GenerateExportHeader-custom-content.rst b/Help/release/dev/GenerateExportHeader-custom-content.rst
new file mode 100644
index 0000000..161261c
--- /dev/null
+++ b/Help/release/dev/GenerateExportHeader-custom-content.rst
@@ -0,0 +1,6 @@
+GenerateExportHeader-custom-content
+-----------------------------------
+
+* The :module:`GenerateExportHeader` module learned a new
+ ``CUSTOM_CONTENT_FROM_VARIABLE`` option to specify a variable
+ containing custom content for inclusion in the generated header.
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 6389d30..6205b8c 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -20,6 +20,7 @@
# [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
# [DEFINE_NO_DEPRECATED]
# [PREFIX_NAME <prefix_name>]
+# [CUSTOM_CONTENT_FROM_VARIABLE <variable>]
# )
#
#
@@ -60,8 +61,10 @@
# The CMake fragment will generate a file in the
# ``${CMAKE_CURRENT_BINARY_DIR}`` called ``somelib_export.h`` containing the
# macros ``SOMELIB_EXPORT``, ``SOMELIB_NO_EXPORT``, ``SOMELIB_DEPRECATED``,
-# ``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``. The
-# resulting file should be installed with other headers in the library.
+# ``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``.
+# They will be followed by content taken from the variable specified by
+# the ``CUSTOM_CONTENT_FROM_VARIABLE`` option, if any.
+# The resulting file should be installed with other headers in the library.
#
# The ``BASE_NAME`` argument can be used to override the file name and the
# names used for the macros:
@@ -288,7 +291,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
set(options DEFINE_NO_DEPRECATED)
set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME
DEPRECATED_MACRO_NAME NO_EXPORT_MACRO_NAME STATIC_DEFINE
- NO_DEPRECATED_MACRO_NAME)
+ NO_DEPRECATED_MACRO_NAME CUSTOM_CONTENT_FROM_VARIABLE)
set(multiValueArgs)
cmake_parse_arguments(_GEH "${options}" "${oneValueArgs}" "${multiValueArgs}"
@@ -361,6 +364,14 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
endif()
string(MAKE_C_IDENTIFIER ${EXPORT_IMPORT_CONDITION} EXPORT_IMPORT_CONDITION)
+ if(_GEH_CUSTOM_CONTENT_FROM_VARIABLE)
+ if(DEFINED "${_GEH_CUSTOM_CONTENT_FROM_VARIABLE}")
+ set(CUSTOM_CONTENT "${${_GEH_CUSTOM_CONTENT_FROM_VARIABLE}}")
+ else()
+ set(CUSTOM_CONTENT "")
+ endif()
+ endif()
+
configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in"
"${EXPORT_FILE_NAME}" @ONLY)
endmacro()
diff --git a/Modules/exportheader.cmake.in b/Modules/exportheader.cmake.in
index 7cfbcbd..9dd75bf 100644
--- a/Modules/exportheader.cmake.in
+++ b/Modules/exportheader.cmake.in
@@ -38,5 +38,5 @@
# define @NO_DEPRECATED_MACRO_NAME@
# endif
#endif
-
+@CUSTOM_CONTENT@
#endif
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 9d2e2d4..94f6daf 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 6)
-set(CMake_VERSION_PATCH 20160629)
+set(CMake_VERSION_PATCH 20160630)
#set(CMake_VERSION_RC 1)
diff --git a/Source/Checks/cm_cxx_override.cxx b/Source/Checks/cm_cxx_override.cxx
index e196968..5a33fbb 100644
--- a/Source/Checks/cm_cxx_override.cxx
+++ b/Source/Checks/cm_cxx_override.cxx
@@ -1,11 +1,13 @@
struct Foo
{
+ Foo() {}
virtual ~Foo() {}
virtual int test() const = 0;
};
struct Bar : Foo
{
+ Bar() {}
~Bar() override {}
int test() const override { return 0; }
};
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 7d35a9e..805d8e8 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -333,14 +333,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
fprintf(fout, "set(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}"
" ${COMPILE_DEFINITIONS}\")\n",
li->c_str(), li->c_str());
- static std::string const cfgDefault = "DEBUG";
- std::string const cfg =
- !tcConfig.empty() ? cmSystemTools::UpperCase(tcConfig) : cfgDefault;
- std::string const langFlagsCfg = "CMAKE_" + *li + "_FLAGS_" + cfg;
- const char* flagsCfg = this->Makefile->GetDefinition(langFlagsCfg);
- fprintf(
- fout, "set(%s %s)\n", langFlagsCfg.c_str(),
- cmOutputConverter::EscapeForCMake(flagsCfg ? flagsCfg : "").c_str());
}
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0056)) {
case cmPolicies::WARN:
diff --git a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
index c1be125..a057746 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
@@ -25,9 +25,12 @@ add_library(shared_variant SHARED ${lib_SRCS})
set_target_properties(shared_variant PROPERTIES DEFINE_SYMBOL SHARED_VARIANT_MAKEDLL)
add_library(static_variant ${lib_SRCS})
+set(MY_CUSTOM_CONTENT "#define MY_CUSTOM_CONTENT_ADDED")
+
generate_export_header(shared_variant
BASE_NAME libshared_and_static
PREFIX_NAME MYPREFIX_
+ CUSTOM_CONTENT_FROM_VARIABLE MY_CUSTOM_CONTENT
)
set_target_properties(static_variant PROPERTIES COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
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 2764905..846c207 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,10 @@
#include "libshared_and_static.h"
+#ifndef MY_CUSTOM_CONTENT_ADDED
+#error "MY_CUSTOM_CONTENT_ADDED not defined!"
+#endif
+
int LibsharedAndStatic::libshared_and_static() const
{
return 0;
diff --git a/Tests/RunCMake/try_compile/CompileFlags.cmake b/Tests/RunCMake/try_compile/CompileFlags.cmake
deleted file mode 100644
index d4dc074..0000000
--- a/Tests/RunCMake/try_compile/CompileFlags.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-enable_language(C)
-set(CMAKE_C_FLAGS_RELEASE "-DPP_ERROR ${CMAKE_C_FLAGS_DEBUG}")
-
-#-----------------------------------------------------------------------------
-set(CMAKE_TRY_COMPILE_CONFIGURATION Release)
-try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/src.c
- OUTPUT_VARIABLE out
- )
-string(REPLACE "\n" "\n " out " ${out}")
-if(RESULT)
- message(FATAL_ERROR "try_compile passed but should have failed:\n${out}")
-elseif(NOT "x${out}" MATCHES "PP_ERROR is defined")
- message(FATAL_ERROR "try_compile did not fail with PP_ERROR:\n${out}")
-else()
- message(STATUS "try_compile with per-config flag worked as expected")
-endif()
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index ec099fe..4f30f1d 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -25,7 +25,6 @@ run_cmake(TargetTypeInvalid)
run_cmake(TargetTypeStatic)
run_cmake(CMP0056)
-run_cmake(CompileFlags)
if(RunCMake_GENERATOR MATCHES "Make|Ninja")
# Use a single build tree for a few tests without cleaning.
diff --git a/Tests/RunCMake/try_compile/src.c b/Tests/RunCMake/try_compile/src.c
index 5e51382..8488f4e 100644
--- a/Tests/RunCMake/try_compile/src.c
+++ b/Tests/RunCMake/try_compile/src.c
@@ -2,6 +2,3 @@ int main(void)
{
return 0;
}
-#ifdef PP_ERROR
-#error PP_ERROR is defined
-#endif
diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt
index 8920536..e806680 100644
--- a/Utilities/cmliblzma/CMakeLists.txt
+++ b/Utilities/cmliblzma/CMakeLists.txt
@@ -182,10 +182,6 @@ SET(LZMA_SRCS
liblzma/simple/x86.c
)
-IF(WIN32 AND BUILD_SHARED_LIBS)
- SET(LZMA_SRCS ${LZMA_SRCS} liblzma/liblzma_w32res.rc)
-ENDIF()
-
CONFIGURE_FILE(config.h.in config.h @ONLY)
INCLUDE_DIRECTORIES(
@@ -209,7 +205,7 @@ ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
ENDIF()
-ADD_LIBRARY(cmliblzma ${LZMA_SRCS})
+ADD_LIBRARY(cmliblzma STATIC ${LZMA_SRCS})
IF(CMAKE_C_COMPILER_ID STREQUAL "XL")
# Disable the XL compiler optimizer because it causes crashes