summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/install.rst2
-rw-r--r--Help/manual/cmake-buildsystem.7.rst4
-rw-r--r--Help/policy/CMP0091.rst4
-rw-r--r--Help/prop_tgt/ENABLE_EXPORTS.rst4
-rw-r--r--Help/prop_tgt/IMPORTED_IMPLIB.rst6
-rw-r--r--Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst3
-rw-r--r--Help/release/dev/aix.rst20
-rw-r--r--Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst5
-rw-r--r--Modules/FindPython/Support.cmake21
-rw-r--r--Modules/FindVulkan.cmake2
-rw-r--r--Modules/Platform/AIX-GNU.cmake12
-rw-r--r--Modules/Platform/AIX-XL.cmake12
-rw-r--r--Modules/Platform/AIX.cmake2
-rwxr-xr-xModules/Platform/AIX/ExportImportList7
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx24
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx18
-rw-r--r--Source/cmComputeLinkInformation.cxx9
-rw-r--r--Source/cmELF.cxx54
-rw-r--r--Source/cmELF.h3
-rw-r--r--Source/cmForEachCommand.cxx22
-rw-r--r--Source/cmFunctionCommand.cxx8
-rw-r--r--Source/cmGeneratorTarget.cxx3
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx4
-rw-r--r--Source/cmIfCommand.cxx22
-rw-r--r--Source/cmInstallCommand.cxx3
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx3
-rw-r--r--Source/cmMacroCommand.cxx8
-rw-r--r--Source/cmMakefile.cxx21
-rw-r--r--Source/cmMakefile.h6
-rw-r--r--Source/cmTarget.cxx9
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx3
-rw-r--r--Source/cmWhileCommand.cxx13
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py9
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake2
38 files changed, 217 insertions, 139 deletions
diff --git a/Help/command/install.rst b/Help/command/install.rst
index ab6fef6..5affc5b 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -126,6 +126,8 @@ project. There are several kinds of target files that may be installed:
marked with the ``FRAMEWORK`` property on macOS (see ``FRAMEWORK``
below.) For DLL platforms (all Windows-based systems including
Cygwin), the DLL import library is treated as an ``ARCHIVE`` target.
+ On AIX, the linker import file created for executables with
+ :prop_tgt:`ENABLE_EXPORTS` is treated as an ``ARCHIVE`` target.
``LIBRARY``
Module libraries are always treated as ``LIBRARY`` targets. For non-
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index 8cd6e68..d8142a2 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -811,6 +811,10 @@ An *archive* output artifact of a buildsystem target may be:
executable target created by the :command:`add_executable` command
when its :prop_tgt:`ENABLE_EXPORTS` target property is set.
+* On AIX: the linker import file (e.g. ``.imp``) of an executable target
+ created by the :command:`add_executable` command when its
+ :prop_tgt:`ENABLE_EXPORTS` target property is set.
+
The :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY` and :prop_tgt:`ARCHIVE_OUTPUT_NAME`
target properties may be used to control archive output artifact locations
and names in the build tree.
diff --git a/Help/policy/CMP0091.rst b/Help/policy/CMP0091.rst
index 5b7c4e3..1a5878a 100644
--- a/Help/policy/CMP0091.rst
+++ b/Help/policy/CMP0091.rst
@@ -20,7 +20,9 @@ CMake 3.15 and above prefer to leave the MSVC runtime library selection flags
out of the default :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` values and instead
offer a first-class abstraction. The :variable:`CMAKE_MSVC_RUNTIME_LIBRARY`
variable and :prop_tgt:`MSVC_RUNTIME_LIBRARY` target property may be set to
-select the MSVC runtime library.
+select the MSVC runtime library. If they are not set then CMake uses the
+default value ``MultiThreaded$<$<CONFIG:Debug>:Debug>DLL`` which is
+equivalent to the original flags.
This policy provides compatibility with projects that have not been updated
to be aware of the abstraction. The policy setting takes effect as of the
diff --git a/Help/prop_tgt/ENABLE_EXPORTS.rst b/Help/prop_tgt/ENABLE_EXPORTS.rst
index daef78b..0b1064a 100644
--- a/Help/prop_tgt/ENABLE_EXPORTS.rst
+++ b/Help/prop_tgt/ENABLE_EXPORTS.rst
@@ -19,6 +19,10 @@ varies by platform:
* On macOS, loadable modules link to the executable itself using the
``-bundle_loader`` flag.
+* On AIX, a linker "import file" is created along with the executable
+ to list the exported symbols for import when linking other targets.
+ Loadable modules link to the import file to get the symbols.
+
* On other platforms, loadable modules are simply linked without
referencing the executable since the dynamic loader will
automatically bind symbols when the module is loaded.
diff --git a/Help/prop_tgt/IMPORTED_IMPLIB.rst b/Help/prop_tgt/IMPORTED_IMPLIB.rst
index 77fb552..c8b6fde 100644
--- a/Help/prop_tgt/IMPORTED_IMPLIB.rst
+++ b/Help/prop_tgt/IMPORTED_IMPLIB.rst
@@ -3,5 +3,7 @@ IMPORTED_IMPLIB
Full path to the import library for an ``IMPORTED`` target.
-Set this to the location of the ``.lib`` part of a Windows DLL. Ignored
-for non-imported targets.
+Set this to the location of the ``.lib`` part of a Windows DLL, or on
+AIX set it to an import file created for executables that export symbols
+(see the :prop_tgt:`ENABLE_EXPORTS` target property).
+Ignored for non-imported targets.
diff --git a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
index 1e3f5e9..73792de 100644
--- a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
+++ b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
@@ -19,6 +19,9 @@ support per-configuration specification. For example, the code:
selects for the target ``foo`` a multi-threaded statically-linked runtime
library with or without debug information depending on the configuration.
+If this property is not set then CMake uses the default value
+``MultiThreaded$<$<CONFIG:Debug>:Debug>DLL`` to select a MSVC runtime library.
+
.. note::
This property has effect only when policy :policy:`CMP0091` is set to ``NEW``
diff --git a/Help/release/dev/aix.rst b/Help/release/dev/aix.rst
new file mode 100644
index 0000000..6919358
--- /dev/null
+++ b/Help/release/dev/aix.rst
@@ -0,0 +1,20 @@
+aix
+---
+
+* On AIX, executables using the :prop_tgt:`ENABLE_EXPORTS` target property
+ now produce a linker import file with a ``.imp`` extension in addition
+ to the executable file. Plugins (created via :command:`add_library` with
+ the ``MODULE`` option) that use :command:`target_link_libraries` to link
+ to the executable for its symbols are now linked using the import file.
+ The :command:`install(TARGETS)` command now installs the import file as
+ an ``ARCHIVE`` artifact.
+
+* On AIX, runtime linking is no longer enabled by default. CMake provides
+ the linker enough information to resolve all symbols up front.
+ One may manually enable runtime linking for shared libraries and/or
+ loadable modules by adding ``-Wl,-G`` to their link flags
+ (e.g. in the :variable:`CMAKE_SHARED_LINKER_FLAGS` or
+ :variable:`CMAKE_MODULE_LINKER_FLAGS` variable).
+ One may manually enable runtime linking for executables by adding
+ ``-Wl,-brtl`` to their link flags (e.g. in the
+ :variable:`CMAKE_EXE_LINKER_FLAGS` variable).
diff --git a/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst b/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst
index 6ed68c9..8b54e7e 100644
--- a/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst
+++ b/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst
@@ -20,6 +20,11 @@ support per-configuration specification. For example, the code:
selects for all following targets a multi-threaded statically-linked runtime
library with or without debug information depending on the configuration.
+If this variable is not set then the :prop_tgt:`MSVC_RUNTIME_LIBRARY` target
+property will not be set automatically. If that property is not set then
+CMake uses the default value ``MultiThreaded$<$<CONFIG:Debug>:Debug>DLL``
+to select a MSVC runtime library.
+
.. note::
This variable has effect only when policy :policy:`CMP0091` is set to ``NEW``
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index c0e843a..8faec03 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -54,7 +54,7 @@ endmacro()
macro (_PYTHON_FIND_FRAMEWORKS)
set (${_PYTHON_PREFIX}_FRAMEWORKS)
- if (APPLE)
+ if (CMAKE_HOST_APPLE OR APPLE)
set (_pff_frameworks ${CMAKE_FRAMEWORK_PATH}
$ENV{CMAKE_FRAMEWORK_PATH}
~/Library/Frameworks
@@ -623,7 +623,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
# Apple frameworks handling
- if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST")
+ if (CMAKE_HOST_APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST")
find_program (${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
NAMES_PER_DIR
@@ -640,7 +640,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
endif()
# Windows registry
- if (WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "FIRST")
+ if (CMAKE_HOST_WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "FIRST")
find_program (${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}
@@ -681,7 +681,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
# Apple frameworks handling
- if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "LAST")
+ if (CMAKE_HOST_APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "LAST")
find_program (${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
NAMES_PER_DIR
@@ -694,7 +694,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
endif()
# Windows registry
- if (WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "LAST")
+ if (CMAKE_HOST_WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "LAST")
find_program (${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}
@@ -743,7 +743,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
# Apple frameworks handling
- if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST")
+ if (CMAKE_HOST_APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST")
find_program (${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
NAMES_PER_DIR
@@ -757,7 +757,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
# Windows registry
- if (WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "FIRST")
+ if (CMAKE_HOST_WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "FIRST")
find_program (${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}
@@ -793,7 +793,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
# For example, typical systems have 'python' for version 2.* and 'python3'
# for version 3.*. So looking for names per dir will find, potentially,
# systematically 'python' (i.e. version 2) even if version 3 is searched.
- if (WIN32)
+ if (CMAKE_HOST_WIN32)
find_program (${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
python
@@ -808,7 +808,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
# Apple frameworks handling
- if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "LAST")
+ if (CMAKE_HOST_APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "LAST")
find_program (${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
NAMES_PER_DIR
@@ -818,7 +818,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
# Windows registry
- if (WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "LAST")
+ if (CMAKE_HOST_WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "LAST")
find_program (${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}
@@ -1145,7 +1145,6 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
else()
list (REMOVE_ITEM CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
- else()
endif()
# if python interpreter is found, use its location and version to ensure consistency
diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake
index ae8d72d..55da55f 100644
--- a/Modules/FindVulkan.cmake
+++ b/Modules/FindVulkan.cmake
@@ -5,7 +5,7 @@
FindVulkan
----------
-Find Vulkan, which isis a low-overhead, cross-platform 3D graphics
+Find Vulkan, which is a low-overhead, cross-platform 3D graphics
and computing API.
IMPORTED Targets
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake
index cec71a1..61d213a 100644
--- a/Modules/Platform/AIX-GNU.cmake
+++ b/Modules/Platform/AIX-GNU.cmake
@@ -8,16 +8,10 @@ if(__AIX_COMPILER_GNU)
endif()
set(__AIX_COMPILER_GNU 1)
-#
-# By default, runtime linking is enabled. All shared objects specified on the command line
-# will be listed, even if there are no symbols referenced, in the output file.
-string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl")
-
-
macro(__aix_compiler_gnu lang)
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
- string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-G,-bnoipath")
+ string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-bnoipath")
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior
set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1)
@@ -34,6 +28,6 @@ macro(__aix_compiler_gnu lang)
)
set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS
- "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp <OBJECTS>"
- "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+ "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -l . <OBJECTS>"
+ "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endmacro()
diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake
index 52292bd..64b0bc1 100644
--- a/Modules/Platform/AIX-XL.cmake
+++ b/Modules/Platform/AIX-XL.cmake
@@ -8,16 +8,10 @@ if(__AIX_COMPILER_XL)
endif()
set(__AIX_COMPILER_XL 1)
-#
-# By default, runtime linking is enabled. All shared objects specified on the command line
-# will be listed, even if there are no symbols referenced, in the output file.
-string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl")
-
-
macro(__aix_compiler_xl lang)
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
- set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-bnoipath") # -shared
+ string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-bnoipath")
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ")
set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ")
@@ -32,6 +26,6 @@ macro(__aix_compiler_xl lang)
)
set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS
- "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp <OBJECTS>"
- "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+ "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -l . <OBJECTS>"
+ "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endmacro()
diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake
index 551a995..03cef51 100644
--- a/Modules/Platform/AIX.cmake
+++ b/Modules/Platform/AIX.cmake
@@ -1,5 +1,7 @@
set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
+set(CMAKE_AIX_IMPORT_FILE_PREFIX "")
+set(CMAKE_AIX_IMPORT_FILE_SUFFIX ".imp")
set(CMAKE_DL_LIBS "-lld")
# RPATH support on AIX is called libpath. By default the runtime
diff --git a/Modules/Platform/AIX/ExportImportList b/Modules/Platform/AIX/ExportImportList
index c17378c..4f67ef5 100755
--- a/Modules/Platform/AIX/ExportImportList
+++ b/Modules/Platform/AIX/ExportImportList
@@ -5,7 +5,7 @@
# This script is internal to CMake and meant only to be
# invoked by CMake-generated build systems on AIX.
-usage='usage: ExportImportList -o <out-file> [--] <objects>...'
+usage='usage: ExportImportList -o <out-file> [-l <lib>] [--] <objects>...'
die() {
echo "$@" 1>&2; exit 1
@@ -13,8 +13,10 @@ die() {
# Process command-line arguments.
out=''
+lib=''
while test "$#" != 0; do
case "$1" in
+ -l) shift; lib="$1" ;;
-o) shift; out="$1" ;;
--) shift; break ;;
-*) die "$usage" ;;
@@ -44,5 +46,8 @@ done > "$out_tmp"
# Generate the export/import file.
{
+ if test -n "$lib"; then
+ echo "#! $lib"
+ fi
sort -u "$out_tmp"
} > "$out"
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 9c00c80..cf21839 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 20190717)
+set(CMake_VERSION_PATCH 20190719)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 861bd06..85040dd 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -4,13 +4,6 @@
#include "cmsys/Directory.hxx"
#include "cmsys/Process.h"
-#include <map>
-#include <ratio>
-#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <utility>
#include "cm_memory.hxx"
@@ -41,6 +34,15 @@
#include "cmSystemTools.h"
#include "cmake.h"
+#include <map>
+#include <memory>
+#include <ratio>
+#include <sstream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <utility>
+
#ifdef _WIN32
# include <windows.h>
#else
@@ -372,9 +374,11 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
#endif
// always add a function blocker to update the elapsed time
- cmCTestScriptFunctionBlocker* f = new cmCTestScriptFunctionBlocker();
- f->CTestScriptHandler = this;
- this->Makefile->AddFunctionBlocker(f);
+ {
+ auto fb = cm::make_unique<cmCTestScriptFunctionBlocker>();
+ fb->CTestScriptHandler = this;
+ this->Makefile->AddFunctionBlocker(std::move(fb));
+ }
/* Execute CTestScriptMode.cmake, which loads CMakeDetermineSystem and
CMakeSystemSpecificInformation, so
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 1fa7988..54c4bae 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -266,15 +266,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
}
}
- upload_as += "&MD5=";
-
- if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) {
- upload_as += "bad_md5sum";
- } else {
- upload_as +=
- cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5);
- }
-
// Generate Done.xml right before it is submitted.
// The reason for this is two-fold:
// 1) It must be generated after some other part has been submitted
@@ -286,6 +277,15 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
this->CTest->GenerateDoneFile();
}
+ upload_as += "&MD5=";
+
+ if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) {
+ upload_as += "bad_md5sum";
+ } else {
+ upload_as +=
+ cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5);
+ }
+
if (!cmSystemTools::FileExists(local_file)) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
" Cannot find file: " << local_file << std::endl);
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 5a03670..f696f28 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -616,6 +616,15 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
// Pass the full path to the target file.
std::string lib = tgt->GetFullPath(config, artifact, true);
+ if (tgt->Target->IsAIX() && cmHasLiteralSuffix(lib, "-NOTFOUND") &&
+ artifact == cmStateEnums::ImportLibraryArtifact) {
+ // This is an imported executable on AIX that has ENABLE_EXPORTS
+ // but not IMPORTED_IMPLIB. CMake used to produce and accept such
+ // imported executables on AIX before we taught it to use linker
+ // import files. For compatibility, simply skip linking to this
+ // executable as we did before. It works with runtime linking.
+ return;
+ }
if (!this->LinkDependsNoShared ||
tgt->GetType() != cmStateEnums::SHARED_LIBRARY) {
this->Depends.push_back(lib);
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 51eb814..096016d 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -4,6 +4,7 @@
#include "cmAlgorithms.h"
#include "cm_kwiml.h"
+#include "cm_memory.hxx"
#include "cmsys/FStream.hxx"
#include <map>
#include <memory>
@@ -109,10 +110,10 @@ public:
};
// Construct and take ownership of the file stream object.
- cmELFInternal(cmELF* external, std::unique_ptr<cmsys::ifstream>& fin,
+ cmELFInternal(cmELF* external, std::unique_ptr<std::istream> fin,
ByteOrderType order)
: External(external)
- , Stream(*fin.release())
+ , Stream(std::move(fin))
, ByteOrder(order)
, ELFType(cmELF::FileTypeInvalid)
{
@@ -132,7 +133,7 @@ public:
}
// Destruct and delete the file stream object.
- virtual ~cmELFInternal() { delete &this->Stream; }
+ virtual ~cmELFInternal() = default;
// Forward to the per-class implementation.
virtual unsigned int GetNumberOfSections() const = 0;
@@ -171,7 +172,7 @@ protected:
cmELF* External;
// The stream from which to read.
- std::istream& Stream;
+ std::unique_ptr<std::istream> Stream;
// The byte order of the ELF file.
ByteOrderType ByteOrder;
@@ -233,7 +234,7 @@ public:
typedef typename Types::tagtype tagtype;
// Construct with a stream and byte swap indicator.
- cmELFInternalImpl(cmELF* external, std::unique_ptr<cmsys::ifstream>& fin,
+ cmELFInternalImpl(cmELF* external, std::unique_ptr<std::istream> fin,
ByteOrderType order);
// Return the number of sections as specified by the ELF header.
@@ -352,7 +353,7 @@ private:
bool Read(ELF_Ehdr& x)
{
// Read the header from the file.
- if (!this->Stream.read(reinterpret_cast<char*>(&x), sizeof(x))) {
+ if (!this->Stream->read(reinterpret_cast<char*>(&x), sizeof(x))) {
return false;
}
@@ -382,26 +383,26 @@ private:
}
bool Read(ELF_Shdr& x)
{
- if (this->Stream.read(reinterpret_cast<char*>(&x), sizeof(x)) &&
+ if (this->Stream->read(reinterpret_cast<char*>(&x), sizeof(x)) &&
this->NeedSwap) {
ByteSwap(x);
}
- return !this->Stream.fail();
+ return !this->Stream->fail();
}
bool Read(ELF_Dyn& x)
{
- if (this->Stream.read(reinterpret_cast<char*>(&x), sizeof(x)) &&
+ if (this->Stream->read(reinterpret_cast<char*>(&x), sizeof(x)) &&
this->NeedSwap) {
ByteSwap(x);
}
- return !this->Stream.fail();
+ return !this->Stream->fail();
}
bool LoadSectionHeader(ELF_Half i)
{
// Read the section header from the file.
- this->Stream.seekg(this->ELFHeader.e_shoff +
- this->ELFHeader.e_shentsize * i);
+ this->Stream->seekg(this->ELFHeader.e_shoff +
+ this->ELFHeader.e_shentsize * i);
if (!this->Read(this->SectionHeaders[i])) {
return false;
}
@@ -426,9 +427,10 @@ private:
};
template <class Types>
-cmELFInternalImpl<Types>::cmELFInternalImpl(
- cmELF* external, std::unique_ptr<cmsys::ifstream>& fin, ByteOrderType order)
- : cmELFInternal(external, fin, order)
+cmELFInternalImpl<Types>::cmELFInternalImpl(cmELF* external,
+ std::unique_ptr<std::istream> fin,
+ ByteOrderType order)
+ : cmELFInternal(external, std::move(fin), order)
{
// Read the main header.
if (!this->Read(this->ELFHeader)) {
@@ -510,7 +512,7 @@ bool cmELFInternalImpl<Types>::LoadDynamicSection()
// Read each entry.
for (int j = 0; j < n; ++j) {
// Seek to the beginning of the section entry.
- this->Stream.seekg(sec.sh_offset + sec.sh_entsize * j);
+ this->Stream->seekg(sec.sh_offset + sec.sh_entsize * j);
ELF_Dyn& dyn = this->DynamicSectionEntries[j];
// Try reading the entry.
@@ -630,7 +632,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
unsigned long first = static_cast<unsigned long>(dyn.d_un.d_val);
unsigned long last = first;
unsigned long end = static_cast<unsigned long>(strtab.sh_size);
- this->Stream.seekg(strtab.sh_offset + first);
+ this->Stream->seekg(strtab.sh_offset + first);
// Read the string. It may be followed by more than one NULL
// terminator. Count the total size of the region allocated to
@@ -639,7 +641,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
// assumption.
bool terminated = false;
char c;
- while (last != end && this->Stream.get(c) && !(terminated && c)) {
+ while (last != end && this->Stream->get(c) && !(terminated && c)) {
++last;
if (c) {
se.Value += c;
@@ -649,7 +651,7 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
}
// Make sure the whole value was read.
- if (!this->Stream) {
+ if (!(*this->Stream)) {
this->SetErrorMessage("Dynamic section specifies unreadable RPATH.");
se.Value = "";
return nullptr;
@@ -679,10 +681,9 @@ const long cmELF::TagMipsRldMapRel = 0;
#endif
cmELF::cmELF(const char* fname)
- : Internal(nullptr)
{
// Try to open the file.
- std::unique_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname));
+ auto fin = cm::make_unique<cmsys::ifstream>(fname);
// Quit now if the file could not be opened.
if (!fin || !*fin) {
@@ -725,12 +726,14 @@ cmELF::cmELF(const char* fname)
// parser implementation.
if (ident[EI_CLASS] == ELFCLASS32) {
// 32-bit ELF
- this->Internal = new cmELFInternalImpl<cmELFTypes32>(this, fin, order);
+ this->Internal = cm::make_unique<cmELFInternalImpl<cmELFTypes32>>(
+ this, std::move(fin), order);
}
#ifndef _SCO_DS
else if (ident[EI_CLASS] == ELFCLASS64) {
// 64-bit ELF
- this->Internal = new cmELFInternalImpl<cmELFTypes64>(this, fin, order);
+ this->Internal = cm::make_unique<cmELFInternalImpl<cmELFTypes64>>(
+ this, std::move(fin), order);
}
#endif
else {
@@ -739,10 +742,7 @@ cmELF::cmELF(const char* fname)
}
}
-cmELF::~cmELF()
-{
- delete this->Internal;
-}
+cmELF::~cmELF() = default;
bool cmELF::Valid() const
{
diff --git a/Source/cmELF.h b/Source/cmELF.h
index 987f0c3..afef654 100644
--- a/Source/cmELF.h
+++ b/Source/cmELF.h
@@ -6,6 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
@@ -108,7 +109,7 @@ public:
private:
friend class cmELFInternal;
bool Valid() const;
- cmELFInternal* Internal;
+ std::unique_ptr<cmELFInternal> Internal;
std::string ErrorMessage;
};
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 94c1b1a..a30ebe1 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -5,6 +5,7 @@
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
+#include <utility>
#include "cm_memory.hxx"
@@ -121,7 +122,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
}
// create a function blocker
- auto f = cm::make_unique<cmForEachFunctionBlocker>(this->Makefile);
+ auto fb = cm::make_unique<cmForEachFunctionBlocker>(this->Makefile);
if (args.size() > 1) {
if (args[1] == "RANGE") {
int start = 0;
@@ -168,23 +169,22 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
break;
}
}
- f->Args = range;
+ fb->Args = range;
} else {
- f->Args = args;
+ fb->Args = args;
}
} else {
- f->Args = args;
+ fb->Args = args;
}
- this->Makefile->AddFunctionBlocker(f.release());
+ this->Makefile->AddFunctionBlocker(std::move(fb));
return true;
}
bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
{
- std::unique_ptr<cmForEachFunctionBlocker> f(
- new cmForEachFunctionBlocker(this->Makefile));
- f->Args.push_back(args[0]);
+ auto fb = cm::make_unique<cmForEachFunctionBlocker>(this->Makefile);
+ fb->Args.push_back(args[0]);
enum Doing
{
@@ -195,7 +195,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
Doing doing = DoingNone;
for (unsigned int i = 2; i < args.size(); ++i) {
if (doing == DoingItems) {
- f->Args.push_back(args[i]);
+ fb->Args.push_back(args[i]);
} else if (args[i] == "LISTS") {
doing = DoingLists;
} else if (args[i] == "ITEMS") {
@@ -203,7 +203,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
} else if (doing == DoingLists) {
const char* value = this->Makefile->GetDefinition(args[i]);
if (value && *value) {
- cmSystemTools::ExpandListArgument(value, f->Args, true);
+ cmSystemTools::ExpandListArgument(value, fb->Args, true);
}
} else {
std::ostringstream e;
@@ -214,7 +214,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
}
}
- this->Makefile->AddFunctionBlocker(f.release()); // TODO: pass unique_ptr
+ this->Makefile->AddFunctionBlocker(std::move(fb));
return true;
}
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 8e003ad..6d06531 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -179,8 +179,10 @@ bool cmFunctionCommand::InitialPass(std::vector<std::string> const& args,
}
// create a function blocker
- cmFunctionFunctionBlocker* f = new cmFunctionFunctionBlocker();
- cmAppend(f->Args, args);
- this->Makefile->AddFunctionBlocker(f);
+ {
+ auto fb = cm::make_unique<cmFunctionFunctionBlocker>();
+ cmAppend(fb->Args, args);
+ this->Makefile->AddFunctionBlocker(std::move(fb));
+ }
return true;
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index a2c0503..d3e8248 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -6363,7 +6363,8 @@ bool cmGeneratorTarget::HasImportLibrary(std::string const& config) const
this->IsExecutableWithExports()) &&
// Assemblies which have only managed code do not have
// import libraries.
- this->GetManagedType(config) != ManagedType::Managed);
+ this->GetManagedType(config) != ManagedType::Managed) ||
+ (this->Target->IsAIX() && this->IsExecutableWithExports());
}
bool cmGeneratorTarget::NeedImportLibraryName(std::string const& config) const
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 69a7da9..7e81a54 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -639,7 +639,9 @@ void cmGlobalNinjaGenerator::EnableLanguage(
(mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "GNU") ||
(mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "GNU") ||
(mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "Clang") ||
- (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "Clang")))) {
+ (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "Clang") ||
+ (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "QCC") ||
+ (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "QCC")))) {
this->UsingGCCOnWindows = true;
}
#endif
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index c58ad06..625dd45 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmIfCommand.h"
+#include "cm_memory.hxx"
+
#include "cmConditionEvaluator.h"
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h"
@@ -11,6 +13,8 @@
#include "cmSystemTools.h"
#include "cmake.h"
+#include <utility>
+
static std::string cmIfCommandError(
std::vector<cmExpandedCommandArgument> const& args)
{
@@ -200,15 +204,17 @@ bool cmIfCommand::InvokeInitialPass(
this->Makefile->IssueMessage(status, err);
}
- cmIfFunctionBlocker* f = new cmIfFunctionBlocker();
- // if is isn't true block the commands
- f->ScopeDepth = 1;
- f->IsBlocking = !isTrue;
- if (isTrue) {
- f->HasRun = true;
+ {
+ auto fb = cm::make_unique<cmIfFunctionBlocker>();
+ // if is isn't true block the commands
+ fb->ScopeDepth = 1;
+ fb->IsBlocking = !isTrue;
+ if (isTrue) {
+ fb->HasRun = true;
+ }
+ fb->Args = args;
+ this->Makefile->AddFunctionBlocker(std::move(fb));
}
- f->Args = args;
- this->Makefile->AddFunctionBlocker(f);
return true;
}
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 750ed8c..3b0659c 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -637,7 +637,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// On DLL platforms an executable may also have an import
// library. Install it to the archive destination if it
// exists.
- if (target.IsDLLPlatform() && !archiveArgs.GetDestination().empty() &&
+ if ((target.IsDLLPlatform() || target.IsAIX()) &&
+ !archiveArgs.GetDestination().empty() &&
target.IsExecutableWithExports()) {
// The import library uses the ARCHIVE properties.
archiveGenerator = CreateInstallTargetGenerator(
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7ba3471..8154f3e 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -703,8 +703,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
}
Options targetOptions(this, t, table, gg->ExtraFlagTable);
targetOptions.FixExceptionHandlingDefault();
- std::string asmLocation = configName + "/";
- targetOptions.AddFlag("AssemblerListingLocation", asmLocation);
+ targetOptions.AddFlag("AssemblerListingLocation", "$(IntDir)\\");
targetOptions.Parse(flags);
targetOptions.Parse(defineFlags);
targetOptions.ParseFinish();
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 3d553b7..6e65c6b 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -213,8 +213,10 @@ bool cmMacroCommand::InitialPass(std::vector<std::string> const& args,
}
// create a function blocker
- cmMacroFunctionBlocker* f = new cmMacroFunctionBlocker();
- cmAppend(f->Args, args);
- this->Makefile->AddFunctionBlocker(f);
+ {
+ auto fb = cm::make_unique<cmMacroFunctionBlocker>();
+ cmAppend(fb->Args, args);
+ this->Makefile->AddFunctionBlocker(std::move(fb));
+ }
return true;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 501ea69..5ae3a29 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -118,7 +118,6 @@ cmMakefile::~cmMakefile()
cmDeleteAll(this->SourceFiles);
cmDeleteAll(this->Tests);
cmDeleteAll(this->ImportedTargetsOwned);
- cmDeleteAll(this->FunctionBlockers);
cmDeleteAll(this->EvaluationFiles);
}
@@ -3076,13 +3075,13 @@ bool cmMakefile::IsFunctionBlocked(const cmListFileFunction& lff,
cmExecutionStatus& status)
{
// if there are no blockers get out of here
- if (this->FunctionBlockers.begin() == this->FunctionBlockers.end()) {
+ if (this->FunctionBlockers.empty()) {
return false;
}
// loop over all function blockers to see if any block this command
// evaluate in reverse, this is critical for balanced IF statements etc
- for (cmFunctionBlocker* pos : cmReverseRange(this->FunctionBlockers)) {
+ for (auto const& pos : cmReverseRange(this->FunctionBlockers)) {
if (pos->IsFunctionBlocked(lff, *this, status)) {
return true;
}
@@ -3102,7 +3101,8 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError)
FunctionBlockersType::size_type barrier =
this->FunctionBlockerBarriers.back();
while (this->FunctionBlockers.size() > barrier) {
- std::unique_ptr<cmFunctionBlocker> fb(this->FunctionBlockers.back());
+ std::unique_ptr<cmFunctionBlocker> fb(
+ std::move(this->FunctionBlockers.back()));
this->FunctionBlockers.pop_back();
if (reportError) {
// Report the context in which the unclosed block was opened.
@@ -3227,14 +3227,14 @@ bool cmMakefile::ExpandArguments(
return !cmSystemTools::GetFatalErrorOccured();
}
-void cmMakefile::AddFunctionBlocker(cmFunctionBlocker* fb)
+void cmMakefile::AddFunctionBlocker(std::unique_ptr<cmFunctionBlocker> fb)
{
if (!this->ExecutionStatusStack.empty()) {
// Record the context in which the blocker is created.
fb->SetStartingContext(this->GetExecutionContext());
}
- this->FunctionBlockers.push_back(fb);
+ this->FunctionBlockers.push_back(std::move(fb));
}
std::unique_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker(
@@ -3250,9 +3250,8 @@ std::unique_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker(
// Search for the function blocker whose scope this command ends.
for (FunctionBlockersType::size_type i = this->FunctionBlockers.size();
i > barrier; --i) {
- std::vector<cmFunctionBlocker*>::iterator pos =
- this->FunctionBlockers.begin() + (i - 1);
- if (*pos == fb) {
+ auto pos = this->FunctionBlockers.begin() + (i - 1);
+ if (pos->get() == fb) {
// Warn if the arguments do not match, but always remove.
if (!(*pos)->ShouldRemove(lff, *this)) {
cmListFileContext const& lfc = fb->GetStartingContext();
@@ -3268,9 +3267,9 @@ std::unique_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker(
/* clang-format on */
this->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
- cmFunctionBlocker* b = *pos;
+ std::unique_ptr<cmFunctionBlocker> b = std::move(*pos);
this->FunctionBlockers.erase(pos);
- return std::unique_ptr<cmFunctionBlocker>(b);
+ return b;
}
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 1b4ead7..924cf24 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -17,6 +17,7 @@
#include <vector>
#include "cmAlgorithms.h"
+#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
#include "cmMessageType.h"
#include "cmNewLineStyle.h"
@@ -36,7 +37,6 @@ class cmCustomCommandLines;
class cmExecutionStatus;
class cmExpandedCommandArgument;
class cmExportBuildFileGenerator;
-class cmFunctionBlocker;
class cmGeneratorExpressionEvaluationFile;
class cmGlobalGenerator;
class cmInstallGenerator;
@@ -95,7 +95,7 @@ public:
/**
* Add a function blocker to this makefile
*/
- void AddFunctionBlocker(cmFunctionBlocker* fb);
+ void AddFunctionBlocker(std::unique_ptr<cmFunctionBlocker> fb);
/// @return whether we are processing the top CMakeLists.txt file.
bool IsRootMakefile() const;
@@ -955,7 +955,7 @@ private:
bool EnforceUniqueDir(const std::string& srcPath,
const std::string& binPath) const;
- typedef std::vector<cmFunctionBlocker*> FunctionBlockersType;
+ typedef std::vector<std::unique_ptr<cmFunctionBlocker>> FunctionBlockersType;
FunctionBlockersType FunctionBlockers;
std::vector<FunctionBlockersType::size_type> FunctionBlockerBarriers;
void PushFunctionBlockerBarrier();
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9290d27..b1a0127 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1716,7 +1716,8 @@ const char* cmTarget::GetSuffixVariableInternal(
? "CMAKE_SHARED_LIBRARY_SUFFIX"
: "CMAKE_EXECUTABLE_SUFFIX");
case cmStateEnums::ImportLibraryArtifact:
- return "CMAKE_IMPORT_LIBRARY_SUFFIX";
+ return (impl->IsAIX ? "CMAKE_AIX_IMPORT_FILE_SUFFIX"
+ : "CMAKE_IMPORT_LIBRARY_SUFFIX");
}
break;
default:
@@ -1756,7 +1757,8 @@ const char* cmTarget::GetPrefixVariableInternal(
? "CMAKE_SHARED_LIBRARY_PREFIX"
: "");
case cmStateEnums::ImportLibraryArtifact:
- return "CMAKE_IMPORT_LIBRARY_PREFIX";
+ return (impl->IsAIX ? "CMAKE_AIX_IMPORT_FILE_PREFIX"
+ : "CMAKE_IMPORT_LIBRARY_PREFIX");
}
break;
default:
@@ -1892,7 +1894,8 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
// library or an executable with exports.
bool allowImp = (this->IsDLLPlatform() &&
(this->GetType() == cmStateEnums::SHARED_LIBRARY ||
- this->IsExecutableWithExports()));
+ this->IsExecutableWithExports())) ||
+ (this->IsAIX() && this->IsExecutableWithExports());
// If a mapping was found, check its configurations.
for (std::vector<std::string>::const_iterator mci = mappedConfigs.begin();
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ae347fe..4a151b3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2649,8 +2649,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
clOptions.AddFlag("UseFullPaths", "false");
}
clOptions.AddFlag("PrecompiledHeader", "NotUsing");
- std::string asmLocation = configName + "/";
- clOptions.AddFlag("AssemblerListingLocation", asmLocation);
+ clOptions.AddFlag("AssemblerListingLocation", "$(IntDir)");
}
}
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 31a878d..a902964 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmWhileCommand.h"
+#include "cm_memory.hxx"
+
#include "cmConditionEvaluator.h"
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h"
@@ -9,6 +11,8 @@
#include "cmMessageType.h"
#include "cmSystemTools.h"
+#include <utility>
+
cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
, Depth(0)
@@ -134,9 +138,10 @@ bool cmWhileCommand::InvokeInitialPass(
}
// create a function blocker
- cmWhileFunctionBlocker* f = new cmWhileFunctionBlocker(this->Makefile);
- f->Args = args;
- this->Makefile->AddFunctionBlocker(f);
-
+ {
+ auto fb = cm::make_unique<cmWhileFunctionBlocker>(this->Makefile);
+ fb->Args = args;
+ this->Makefile->AddFunctionBlocker(std::move(fb));
+ }
return true;
}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index 18b9347..3b0ec6e 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -979,6 +979,11 @@ def gen_check_targets(c, g, inSource):
"_dllExtra": False,
},
{
+ "path": "^lib/my_interface_exe\\.imp$",
+ "_aixExtra": True,
+ "_dllExtra": False,
+ },
+ {
"path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$",
"_dllExtra": True,
},
@@ -4895,6 +4900,10 @@ def gen_check_targets(c, g, inSource):
for e in expected:
e["artifacts"] = filter_list(lambda a: not a["_dllExtra"], e["artifacts"])
+ if "aix" not in sys.platform:
+ for e in expected:
+ e["artifacts"] = filter_list(lambda a: not a.get("_aixExtra", False), e["artifacts"])
+
return expected
def check_targets(c, g, inSource):
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake
index 34e500a..f52776e 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake
@@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_PREFIX static2_import_prefix)
string (APPEND GENERATE_CONTENT
"\ncheck_value (\"TARGET_FILE_PREFIX executable custom\" \"$<TARGET_FILE_PREFIX:exec2>\" \"exec2_prefix\")
-check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,exec2_import_prefix,exec2_prefix>\")
+check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms};AIX>,exec2_import_prefix,exec2_prefix>\")
check_value (\"TARGET_FILE_PREFIX shared custom\" \"$<TARGET_FILE_PREFIX:shared2>\" \"shared2_prefix\")
check_value (\"TARGET_LINKER_FILE_PREFIX shared linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:shared2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,shared2_import_prefix,shared2_prefix>\")
check_value (\"TARGET_FILE_PREFIX static custom\" \"$<TARGET_FILE_PREFIX:static2>\" \"static2_prefix\")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake
index 6bb1e44..bef7bbf 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake
@@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_PREFIX static2_import_prefix)
string (APPEND GENERATE_CONTENT
"\ncheck_value (\"TARGET_FILE_PREFIX executable custom\" \"$<TARGET_FILE_PREFIX:exec2>\" \"exec2_prefix\")
-check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,exec2_import_prefix,exec2_prefix>\")
+check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms};AIX>,exec2_import_prefix,exec2_prefix>\")
check_value (\"TARGET_FILE_PREFIX shared custom\" \"$<TARGET_FILE_PREFIX:shared2>\" \"shared2_prefix\")
check_value (\"TARGET_LINKER_FILE_PREFIX shared linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:shared2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,shared2_import_prefix,shared2_prefix>\")
check_value (\"TARGET_FILE_PREFIX static custom\" \"$<TARGET_FILE_PREFIX:static2>\" \"static2_prefix\")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake
index e1b7654..cefeb86 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake
@@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_SUFFIX static2_import_suffix)
string (APPEND GENERATE_CONTENT
"\ncheck_value (\"TARGET_FILE_SUFFIX executable custom\" \"$<TARGET_FILE_SUFFIX:exec2>\" \"exec2_suffix\")
-check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,exec2_import_suffix,exec2_suffix>\")
+check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms};AIX>,exec2_import_suffix,exec2_suffix>\")
check_value (\"TARGET_FILE_SUFFIX shared custom\" \"$<TARGET_FILE_SUFFIX:shared2>\" \"shared2_suffix\")
check_value (\"TARGET_LINKER_FILE_SUFFIX shared linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:shared2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,shared2_import_suffix,shared2_suffix>\")
check_value (\"TARGET_FILE_SUFFIX static custom\" \"$<TARGET_FILE_SUFFIX:static2>\" \"static2_suffix\")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake
index 78afecd..39e39fd 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake
@@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_SUFFIX static2_import_suffix)
string (APPEND GENERATE_CONTENT
"\ncheck_value (\"TARGET_FILE_SUFFIX executable custom\" \"$<TARGET_FILE_SUFFIX:exec2>\" \"exec2_suffix\")
-check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,exec2_import_suffix,exec2_suffix>\")
+check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms};AIX>,exec2_import_suffix,exec2_suffix>\")
check_value (\"TARGET_FILE_SUFFIX shared custom\" \"$<TARGET_FILE_SUFFIX:shared2>\" \"shared2_suffix\")
check_value (\"TARGET_LINKER_FILE_SUFFIX shared linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:shared2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,shared2_import_suffix,shared2_suffix>\")
check_value (\"TARGET_FILE_SUFFIX static custom\" \"$<TARGET_FILE_SUFFIX:static2>\" \"static2_suffix\")