mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 12:53:55 +08:00
CPack/WIX: Add CPACK_WIX_ARCHITECTURE to support Windows for ARM installers
This commit is contained in:
@@ -328,3 +328,12 @@ Windows using WiX.
|
|||||||
If this variable is set then the inclusion of WixUIExtensions is skipped,
|
If this variable is set then the inclusion of WixUIExtensions is skipped,
|
||||||
i.e. the ``-ext "WixUIExtension"`` command line is not included during
|
i.e. the ``-ext "WixUIExtension"`` command line is not included during
|
||||||
the execution of the WiX light tool.
|
the execution of the WiX light tool.
|
||||||
|
|
||||||
|
.. variable:: CPACK_WIX_ARCHITECTURE
|
||||||
|
|
||||||
|
.. versionadded:: 3.24
|
||||||
|
|
||||||
|
This variable can be optionally set to specify the target architecture
|
||||||
|
of the installer. May for example be set to ``x64`` or ``arm64``.
|
||||||
|
|
||||||
|
When unspecified, CPack will default to ``x64`` or ``x86``.
|
||||||
|
6
Help/release/dev/cpack-wix-arch.rst
Normal file
6
Help/release/dev/cpack-wix-arch.rst
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
cpack-wix-arch
|
||||||
|
--------------
|
||||||
|
|
||||||
|
* The :cpack_gen:`CPack WIX Generator` gained a new variable,
|
||||||
|
:variable:`CPACK_WIX_ARCHITECTURE`, to specify the installer architecture
|
||||||
|
in order to support computers running Windows for ARM.
|
@@ -89,10 +89,21 @@ bool cmCPackWIXGenerator::RunCandleCommand(std::string const& sourceFile,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string arch;
|
||||||
|
if (cmValue archOpt = GetOption("CPACK_WIX_ARCHITECTURE")) {
|
||||||
|
arch = *archOpt;
|
||||||
|
} else {
|
||||||
|
arch = GetArchitecture();
|
||||||
|
cmCPackLogger(
|
||||||
|
cmCPackLog::LOG_VERBOSE,
|
||||||
|
"CPACK_WIX_ARCHITECTURE was not set. Invoking WiX with architecture "
|
||||||
|
<< arch << " . " << std::endl);
|
||||||
|
}
|
||||||
|
|
||||||
std::ostringstream command;
|
std::ostringstream command;
|
||||||
command << QuotePath(executable);
|
command << QuotePath(executable);
|
||||||
command << " -nologo";
|
command << " -nologo";
|
||||||
command << " -arch " << GetArchitecture();
|
command << " -arch " << arch;
|
||||||
command << " -out " << QuotePath(objectFile);
|
command << " -out " << QuotePath(objectFile);
|
||||||
|
|
||||||
for (std::string const& ext : CandleExtensions) {
|
for (std::string const& ext : CandleExtensions) {
|
||||||
|
Reference in New Issue
Block a user