Files
systeminformer/cmake/tools.cmake
dmex c107a17d0d Improve clang-lld and build tooling
Add clang-lld CMake toolchains for x86/x64/ARM64 and update the shared CMake/MSVC logic to handle lld-link limitations, optional clang speculative load hardening, host-architecture tool selection, and user-mode defines that match Common.User.props.

Refresh the Windows build scripts to use the newer MSBuild invocation flags, support CI/binlog/low-priority options, allow build target overrides, switch CustomBuildTool publishing to dotnet msbuild, reorder init so tools build before third-party deps, and let build_zsign sign a single file or an entire output tree.
2026-09-24 14:32:21 +10:00

41 lines
1.3 KiB
CMake

#
# Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved.
#
# This file is part of System Informer.
#
#
# Select the host-architecture build of CustomBuildTool. Do not use
# $ENV{PROCESSOR_ARCHITECTURE} here: it reports the architecture of the running
# process, so a 32-bit cmake.exe (the one Visual Studio ships under
# Program Files (x86)) resolves to "x86" on an AMD64 host and picks the wrong
# build. CMAKE_HOST_SYSTEM_PROCESSOR always reports the real host.
#
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" _si_host_arch)
set(SI_CUSTOM_BUILD_TOOL "${SI_ROOT}/tools/CustomBuildTool/bin/Release/${_si_host_arch}/CustomBuildTool.exe")
unset(_si_host_arch)
if (NOT EXISTS "${SI_CUSTOM_BUILD_TOOL}")
message(FATAL_ERROR "CustomBuildTool.exe not found. Run build\\build_tools.cmd first.")
endif()
function(si_sdkbuild target)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND "${SI_CUSTOM_BUILD_TOOL}" -sdk -$<CONFIG> -${SI_PLATFORM} -cmake
WORKING_DIRECTORY "${SI_ROOT}"
VERBATIM
)
endfunction()
function(si_kphsign target)
add_custom_command(
TARGET ${target}
POST_BUILD
COMMAND "${SI_CUSTOM_BUILD_TOOL}" -kphsign "$<SHELL_PATH:$<TARGET_FILE:${target}>>"
WORKING_DIRECTORY "${SI_ROOT}"
VERBATIM
)
endfunction()