summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:14:14 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:14:14 +0900
commitfa4077b016648a9fd90c99fdb782124a9097df71 (patch)
treeb3d0246ba7f30d9e14cbf6e83b5d2016d7461f1a
parent8eb3b8def198a4eb4f0c63ebebdb5b1a59455f50 (diff)
downloadcmake-fa4077b016648a9fd90c99fdb782124a9097df71.tar.gz
cmake-fa4077b016648a9fd90c99fdb782124a9097df71.tar.bz2
cmake-fa4077b016648a9fd90c99fdb782124a9097df71.zip
Imported Upstream version 3.15.6upstream/3.15.6
-rw-r--r--CompileFlags.cmake12
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake7
-rw-r--r--Modules/CMakeParseImplicitIncludeInfo.cmake2
-rw-r--r--Modules/FindBLAS.cmake8
-rw-r--r--Modules/FindBoost.cmake3
-rw-r--r--Modules/FindGTK2.cmake3
-rw-r--r--Modules/FindPostgreSQL.cmake21
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/Modules/CheckCXXLinkerFlag.cmake25
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx20
-rw-r--r--Tests/FindPostgreSQL/Test/main.c15
-rw-r--r--Tests/RunCMake/CTestCommandLine/show_only_json_check.pycbin1829 -> 1829 bytes
-rw-r--r--Tests/RunCMake/FileAPI/check_index.pycbin8146 -> 8146 bytes
13 files changed, 92 insertions, 26 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 91f2adffe..053259f47 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -54,12 +54,20 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
endif()
# Workaround for TOC Overflow on ppc64
+set(bigTocFlag "")
if(CMAKE_SYSTEM_NAME STREQUAL "AIX" AND
CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-bbigtoc")
+ set(bigTocFlag "-Wl,-bbigtoc")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-multi-toc")
+ set(bigTocFlag "-Wl,--no-multi-toc")
+endif()
+if(bigTocFlag)
+ include(CheckCXXLinkerFlag)
+ check_cxx_linker_flag(${bigTocFlag} BIG_TOC_FLAG_SUPPORTED)
+ if(BIG_TOC_FLAG_SUPPORTED)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${bigTocFlag}")
+ endif()
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index d9002fb0e..edbc23b44 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -284,10 +284,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_cl icl.exe)
endif()
if(CMAKE_VS_PLATFORM_TOOLSET_VERSION)
+ set(id_sep "\\")
if(CMAKE_VS_PLATFORM_TOOLSET_VERSION VERSION_GREATER_EQUAL "14.20")
- set(id_sep ".")
- else()
- set(id_sep "\\")
+ if(EXISTS "${CMAKE_GENERATOR_INSTANCE}/VC/Auxiliary/Build.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}/Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props")
+ set(id_sep ".")
+ endif()
endif()
set(id_toolset_version_props "<Import Project=\"${CMAKE_GENERATOR_INSTANCE}\\VC\\Auxiliary\\Build${id_sep}${CMAKE_VS_PLATFORM_TOOLSET_VERSION}\\Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props\" />")
unset(id_sep)
diff --git a/Modules/CMakeParseImplicitIncludeInfo.cmake b/Modules/CMakeParseImplicitIncludeInfo.cmake
index 91d03cdc9..ff4c32561 100644
--- a/Modules/CMakeParseImplicitIncludeInfo.cmake
+++ b/Modules/CMakeParseImplicitIncludeInfo.cmake
@@ -167,7 +167,7 @@ function(cmake_parse_implicit_include_info text lang dir_var log_var state_var)
set(log "")
# go through each line of output...
- string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
+ string(REGEX REPLACE "\r*\n" ";" output_lines "${text}")
foreach(line IN LISTS output_lines)
if(state STREQUAL start)
string(FIND "${line}" "#include \"...\" search starts here:" rv)
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 77f9d0e40..d3acafcd9 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -481,8 +481,12 @@ if (BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All")
""
)
endif()
- if(NOT BLAS_LIBRARIES)
- find_package(Threads)
+ if(NOT BLAS_LIBRARIES AND (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED))
+ if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
+ find_package(Threads)
+ else()
+ find_package(Threads REQUIRED)
+ endif()
# OpenBLAS (http://www.openblas.net)
check_fortran_libraries(
BLAS_LIBRARIES
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 078000f22..af4947cae 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -449,6 +449,9 @@ if (NOT Boost_NO_BOOST_CMAKE)
# Convert component found variables to standard variables if required
# Necessary for legacy boost-cmake and 1.70 builtin BoostConfig
if(Boost_FIND_COMPONENTS)
+ # Ignore the meta-component "ALL", introduced by Boost 1.73
+ list(REMOVE_ITEM Boost_FIND_COMPONENTS "ALL")
+
foreach(_comp IN LISTS Boost_FIND_COMPONENTS)
if(DEFINED Boost_${_comp}_FOUND)
continue()
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index e3af6766f..83091f3d8 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -259,6 +259,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
gtkmm-2.4
libglade-2.0
libglademm-2.4
+ harfbuzz
pango-1.0
pangomm-1.4
sigc++-2.0
@@ -711,6 +712,8 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_LIBRARY (PANGO pango false true)
_GTK2_ADD_TARGET (PANGO GTK2_DEPENDS gobject glib)
+ _GTK2_FIND_INCLUDE_DIR(HARFBUZZ hb.h)
+
_GTK2_FIND_LIBRARY (PANGOCAIRO pangocairo false true)
_GTK2_ADD_TARGET (PANGOCAIRO GTK2_DEPENDS pango cairo gobject glib)
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index dfece229e..dfdd2111d 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -205,11 +205,22 @@ if (PostgreSQL_INCLUDE_DIR)
endif()
endforeach()
if (_PostgreSQL_VERSION_NUM)
- math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000")
- math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000")
- set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}")
- unset(_PostgreSQL_major_version)
- unset(_PostgreSQL_minor_version)
+ # 9.x and older encoding
+ if (_PostgreSQL_VERSION_NUM LESS 100000)
+ math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000")
+ math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000 / 100")
+ math(EXPR _PostgreSQL_patch_version "${_PostgreSQL_VERSION_NUM} % 100")
+ set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}.${_PostgreSQL_patch_version}")
+ unset(_PostgreSQL_major_version)
+ unset(_PostgreSQL_minor_version)
+ unset(_PostgreSQL_patch_version)
+ else ()
+ math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000")
+ math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000")
+ set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}")
+ unset(_PostgreSQL_major_version)
+ unset(_PostgreSQL_minor_version)
+ endif ()
else ()
foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
if(EXISTS "${_PG_CONFIG_HEADER}")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 3bb8cc37f..ba06c4f7e 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 15)
-set(CMake_VERSION_PATCH 5)
+set(CMake_VERSION_PATCH 6)
#set(CMake_VERSION_RC 0)
diff --git a/Source/Modules/CheckCXXLinkerFlag.cmake b/Source/Modules/CheckCXXLinkerFlag.cmake
new file mode 100644
index 000000000..9ad2ad630
--- /dev/null
+++ b/Source/Modules/CheckCXXLinkerFlag.cmake
@@ -0,0 +1,25 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include_guard(GLOBAL)
+include(CheckCXXSourceCompiles)
+include(CMakeCheckCompilerFlagCommonPatterns)
+
+function(check_cxx_linker_flag _flag _var)
+ set(CMAKE_REQUIRED_LIBRARIES "${_flag}")
+
+ # Normalize locale during test compilation.
+ set(_locale_vars LC_ALL LC_MESSAGES LANG)
+ foreach(v IN LISTS _locale_vars)
+ set(_locale_vars_saved_${v} "$ENV{${v}}")
+ set(ENV{${v}} C)
+ endforeach()
+ check_compiler_flag_common_patterns(_common_patterns)
+ check_cxx_source_compiles("int main() { return 0; }" ${_var}
+ ${_common_patterns}
+ )
+ foreach(v IN LISTS _locale_vars)
+ set(ENV{${v}} ${_locale_vars_saved_${v}})
+ endforeach()
+ set(${_var} "${${_var}}" PARENT_SCOPE)
+endfunction()
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index 1eca1f600..66a57eb10 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -388,15 +388,17 @@ std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const
if (version) {
std::string instancePath;
GetVSInstance(instancePath);
- std::stringstream path;
- path << instancePath;
- path << "/VC/Auxiliary/Build";
- path << (cmSystemTools::VersionCompareGreaterEq(version, "14.20") ? '.'
- : '/');
- path << version;
- path << "/Microsoft.VCToolsVersion." << version << ".props";
-
- std::string toolsetPath = path.str();
+ std::string toolsetDir = instancePath + "/VC/Auxiliary/Build";
+ char sep = '/';
+ if (cmSystemTools::VersionCompareGreaterEq(version, "14.20")) {
+ std::string toolsetDot = toolsetDir + "." + version +
+ "/Microsoft.VCToolsVersion." + version + ".props";
+ if (cmSystemTools::PathExists(toolsetDot)) {
+ sep = '.';
+ }
+ }
+ std::string toolsetPath = toolsetDir + sep + version +
+ "/Microsoft.VCToolsVersion." + version + ".props";
cmSystemTools::ConvertToUnixSlashes(toolsetPath);
return toolsetPath;
}
diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c
index 2cfeed0da..a63377a25 100644
--- a/Tests/FindPostgreSQL/Test/main.c
+++ b/Tests/FindPostgreSQL/Test/main.c
@@ -5,10 +5,19 @@
int main()
{
int version = PQlibVersion();
- int major = version / 10000;
- int minor = version % 10000;
char version_string[100];
- snprintf(version_string, sizeof(version_string), "%d.%d", major, minor);
+ // 9.x and older encoding.
+ if (version < 100000) {
+ int major = version / 10000;
+ int minor = version % 10000 / 100;
+ int patch = version % 100;
+ snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor,
+ patch);
+ } else {
+ int major = version / 10000;
+ int minor = version % 10000;
+ snprintf(version_string, sizeof(version_string), "%d.%d", major, minor);
+ }
printf("Found PostgreSQL version %s, expected version %s\n", version_string,
CMAKE_EXPECTED_POSTGRESQL_VERSION);
return strcmp(version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION);
diff --git a/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc b/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
index 1c49c51c0..4983bf4cc 100644
--- a/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
+++ b/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
Binary files differ
diff --git a/Tests/RunCMake/FileAPI/check_index.pyc b/Tests/RunCMake/FileAPI/check_index.pyc
index b1d5882fa..2ab78376a 100644
--- a/Tests/RunCMake/FileAPI/check_index.pyc
+++ b/Tests/RunCMake/FileAPI/check_index.pyc
Binary files differ