Pinned Clib version
This commit is contained in:
parent
b812ac1350
commit
efeb6e4c2c
Binary file not shown.
@ -1,75 +1,147 @@
|
|||||||
cmake_minimum_required(VERSION 3.21)
|
cmake_minimum_required(VERSION 3.21)
|
||||||
message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
|
|
||||||
|
########################################################################################################################
|
||||||
########################################################################################################################
|
## Define project
|
||||||
## Define project
|
########################################################################################################################
|
||||||
########################################################################################################################
|
project(
|
||||||
project(
|
ArtifactTracker
|
||||||
ArtifactTracker
|
VERSION 1.0.11
|
||||||
VERSION 1.0.11
|
DESCRIPTION "Artifact Tracker"
|
||||||
DESCRIPTION "Artifact Tracker"
|
LANGUAGES CXX)
|
||||||
LANGUAGES CXX)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
|
# Link-time optimization for release builds only (debug builds stay fast).
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
# CommonLibSSE-NG requires the dynamic CRT. Dependencies used to be supplied by
|
||||||
find_path(SIMPLEINI_INCLUDE_DIRS "ConvertUTF.c")
|
# vcpkg (which set this via a preset); now that they come from FetchContent we
|
||||||
|
# set it here so both build.cmd and Visual Studio "Open Folder" pick it up.
|
||||||
configure_file(
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
include(GNUInstallDirs)
|
||||||
@ONLY)
|
|
||||||
|
configure_file(
|
||||||
set(sources
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in
|
||||||
src/Main.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
||||||
src/ArtifactTracker.cpp
|
@ONLY)
|
||||||
src/EventListener.cpp
|
|
||||||
src/BookCheck.cpp
|
set(sources
|
||||||
|
src/Main.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
src/ArtifactTracker.cpp
|
||||||
|
src/EventListener.cpp
|
||||||
source_group(
|
src/BookCheck.cpp
|
||||||
TREE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
FILES
|
${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
||||||
${headers}
|
|
||||||
${sources})
|
source_group(
|
||||||
|
TREE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
########################################################################################################################
|
FILES
|
||||||
## Configure target DLL
|
${headers}
|
||||||
########################################################################################################################
|
${sources})
|
||||||
find_package(CommonLibSSE CONFIG REQUIRED)
|
|
||||||
|
########################################################################################################################
|
||||||
add_commonlibsse_plugin(${PROJECT_NAME} SOURCES ${headers} ${sources})
|
## Fetch dependencies (pinned versions, no vcpkg required)
|
||||||
add_library("${PROJECT_NAME}::${PROJECT_NAME}" ALIAS "${PROJECT_NAME}")
|
########################################################################################################################
|
||||||
|
include(FetchContent)
|
||||||
target_include_directories(${PROJECT_NAME}
|
|
||||||
PRIVATE
|
# DirectXMath - required by DirectXTK.
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
FetchContent_Declare(
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src>
|
DirectXMath
|
||||||
$<INSTALL_INTERFACE:src>
|
URL https://github.com/microsoft/DirectXMath/archive/refs/tags/apr2025.tar.gz
|
||||||
${SIMPLEINI_INCLUDE_DIRS}
|
OVERRIDE_FIND_PACKAGE
|
||||||
)
|
DOWNLOAD_EXTRACT_TIMESTAMP ON
|
||||||
|
EXCLUDE_FROM_ALL
|
||||||
target_include_directories(${PROJECT_NAME}
|
SYSTEM)
|
||||||
PUBLIC
|
FetchContent_MakeAvailable(DirectXMath)
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
add_library("Microsoft::DirectXMath" ALIAS "DirectXMath")
|
||||||
|
|
||||||
target_precompile_headers(${PROJECT_NAME}
|
# DirectXTK - required by CommonLibSSE-NG (find_package(directxtk CONFIG REQUIRED)).
|
||||||
PRIVATE
|
# PATCH_COMMAND fixes its shader-compile step under modern CMake (see the script).
|
||||||
src/PCH.h)
|
FetchContent_Declare(
|
||||||
|
DirectXTK
|
||||||
install(TARGETS ${PROJECT_NAME}
|
URL https://github.com/microsoft/DirectXTK/archive/refs/tags/jul2025.tar.gz
|
||||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
OVERRIDE_FIND_PACKAGE
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP ON
|
||||||
|
EXCLUDE_FROM_ALL
|
||||||
|
SYSTEM
|
||||||
########################################################################################################################
|
PATCH_COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/patch_directxtk.cmake")
|
||||||
## Automatic plugin deployment
|
FetchContent_MakeAvailable(DirectXTK)
|
||||||
########################################################################################################################
|
add_library("Microsoft::DirectXTK" ALIAS "DirectXTK")
|
||||||
|
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
# rapidcsv - header only, required by CommonLibSSE-NG (find_path "rapidcsv.h").
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/../../SKSE/Plugins/")
|
FetchContent_Declare(
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
rapidcsv
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${PROJECT_NAME}> "${CMAKE_CURRENT_SOURCE_DIR}/../../SKSE/Plugins/")
|
URL https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.90.tar.gz
|
||||||
|
OVERRIDE_FIND_PACKAGE
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP ON)
|
||||||
|
FetchContent_MakeAvailable(rapidcsv)
|
||||||
|
set(RAPIDCSV_INCLUDE_DIRS ${rapidcsv_SOURCE_DIR}/src)
|
||||||
|
|
||||||
|
# spdlog - used directly (PCH.h) and by CommonLibSSE-NG.
|
||||||
|
set(SPDLOG_INSTALL ON CACHE BOOL "" FORCE)
|
||||||
|
set(SPDLOG_USE_STD_FORMAT ON CACHE BOOL "" FORCE)
|
||||||
|
FetchContent_Declare(
|
||||||
|
spdlog
|
||||||
|
URL https://github.com/gabime/spdlog/archive/refs/tags/v1.17.0.tar.gz
|
||||||
|
OVERRIDE_FIND_PACKAGE
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP ON)
|
||||||
|
FetchContent_MakeAvailable(spdlog)
|
||||||
|
|
||||||
|
# simpleini - used directly (Util.h).
|
||||||
|
FetchContent_Declare(
|
||||||
|
simpleini
|
||||||
|
URL https://github.com/brofield/simpleini/archive/refs/tags/v4.25.tar.gz
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP ON)
|
||||||
|
FetchContent_MakeAvailable(simpleini)
|
||||||
|
|
||||||
|
# CommonLibSSE-NG - pinned commit (SE + AE + VR runtime support).
|
||||||
|
set(ENABLE_SKYRIM_SE ON CACHE BOOL "" FORCE)
|
||||||
|
set(ENABLE_SKYRIM_AE ON CACHE BOOL "" FORCE)
|
||||||
|
set(ENABLE_SKYRIM_VR ON CACHE BOOL "" FORCE)
|
||||||
|
set(BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
message(STATUS "Fetching CommonLibSSE-NG...")
|
||||||
|
FetchContent_Declare(
|
||||||
|
CommonLibSSE
|
||||||
|
GIT_REPOSITORY https://github.com/alandtse/CommonLibVR
|
||||||
|
GIT_TAG aacbd76c01bff9381e253ffdfcb4f9d5f263f1df)
|
||||||
|
FetchContent_MakeAvailable(CommonLibSSE)
|
||||||
|
|
||||||
|
get_target_property(COMMONLIB_SRC_DIR CommonLibSSE SOURCE_DIR)
|
||||||
|
include(${COMMONLIB_SRC_DIR}/cmake/CommonLibSSE.cmake)
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
## Configure target DLL
|
||||||
|
########################################################################################################################
|
||||||
|
add_commonlibsse_plugin(${PROJECT_NAME} SOURCES ${headers} ${sources})
|
||||||
|
add_library("${PROJECT_NAME}::${PROJECT_NAME}" ALIAS "${PROJECT_NAME}")
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME}
|
||||||
|
PRIVATE
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src>
|
||||||
|
$<INSTALL_INTERFACE:src>
|
||||||
|
${simpleini_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME}
|
||||||
|
PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
|
|
||||||
|
target_precompile_headers(${PROJECT_NAME}
|
||||||
|
PRIVATE
|
||||||
|
src/PCH.h)
|
||||||
|
|
||||||
|
install(TARGETS ${PROJECT_NAME}
|
||||||
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
## Automatic plugin deployment
|
||||||
|
########################################################################################################################
|
||||||
|
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/../../SKSE/Plugins/")
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${PROJECT_NAME}> "${CMAKE_CURRENT_SOURCE_DIR}/../../SKSE/Plugins/")
|
||||||
|
|||||||
@ -13,17 +13,6 @@
|
|||||||
"CMAKE_CXX_FLAGS": "$env{COMMONLIBSSE_COMPILER} $env{COMMONLIBSSE_PLATFORM} $env{COMMONLIBSSE_TEXT}"
|
"CMAKE_CXX_FLAGS": "$env{COMMONLIBSSE_COMPILER} $env{COMMONLIBSSE_PLATFORM} $env{COMMONLIBSSE_TEXT}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "vcpkg",
|
|
||||||
"hidden": true,
|
|
||||||
"cacheVariables": {
|
|
||||||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
|
||||||
"VCPKG_TARGET_TRIPLET": "x64-windows-skse",
|
|
||||||
"VCPKG_HOST_TRIPLET": "x64-windows-skse",
|
|
||||||
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake",
|
|
||||||
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "win32",
|
"name": "win32",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
@ -79,100 +68,68 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "build-tests",
|
|
||||||
"displayName": "Build Tests",
|
|
||||||
"hidden": true,
|
|
||||||
"description": "Include test suites in the build.",
|
|
||||||
"cacheVariables": {
|
|
||||||
"BUILD_TESTS": {
|
|
||||||
"type": "STRING",
|
|
||||||
"value": "ON"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "build-release-msvc",
|
"name": "build-release-msvc",
|
||||||
"inherits": [
|
"inherits": [
|
||||||
"base",
|
"base",
|
||||||
"vcpkg",
|
|
||||||
"win32-unicode",
|
"win32-unicode",
|
||||||
"x64",
|
"x64",
|
||||||
"build-tests",
|
|
||||||
"msvc"
|
"msvc"
|
||||||
],
|
],
|
||||||
"displayName": "Release",
|
"displayName": "Release (MSVC)",
|
||||||
"description": "Optimized release build.",
|
"description": "Optimized release build.",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
"binaryDir": "${sourceDir}/build/release-msvc",
|
"binaryDir": "${sourceDir}/build/release-msvc",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": {
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
"type": "STRING",
|
|
||||||
"value": "Release"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "build-debug-msvc",
|
"name": "build-debug-msvc",
|
||||||
"inherits": [
|
"inherits": [
|
||||||
"base",
|
"base",
|
||||||
"vcpkg",
|
|
||||||
"win32-unicode",
|
"win32-unicode",
|
||||||
"x64",
|
"x64",
|
||||||
"build-tests",
|
|
||||||
"msvc"
|
"msvc"
|
||||||
],
|
],
|
||||||
"displayName": "Debug",
|
"displayName": "Debug (MSVC)",
|
||||||
"description": "Debug build for testing.",
|
"description": "Debug build for testing.",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
"binaryDir": "${sourceDir}/build/debug-msvc",
|
"binaryDir": "${sourceDir}/build/debug-msvc",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": {
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
"type": "STRING",
|
|
||||||
"value": "Debug"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "build-debug-clang-cl",
|
|
||||||
"inherits": [
|
|
||||||
"base",
|
|
||||||
"vcpkg",
|
|
||||||
"win32-unicode",
|
|
||||||
"x64",
|
|
||||||
"build-tests",
|
|
||||||
"clang-cl"
|
|
||||||
],
|
|
||||||
"displayName": "Debug",
|
|
||||||
"description": "Debug build for testing.",
|
|
||||||
"generator": "Ninja",
|
|
||||||
"binaryDir": "${sourceDir}/build/debug-clang",
|
|
||||||
"cacheVariables": {
|
|
||||||
"CMAKE_BUILD_TYPE": {
|
|
||||||
"type": "STRING",
|
|
||||||
"value": "Debug"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "build-release-clang-cl",
|
"name": "build-release-clang-cl",
|
||||||
"inherits": [
|
"inherits": [
|
||||||
"base",
|
"base",
|
||||||
"vcpkg",
|
|
||||||
"win32-unicode",
|
"win32-unicode",
|
||||||
"x64",
|
"x64",
|
||||||
"build-tests",
|
|
||||||
"clang-cl"
|
"clang-cl"
|
||||||
],
|
],
|
||||||
"displayName": "Release",
|
"displayName": "Release (Clang)",
|
||||||
"description": "Optimized release build.",
|
"description": "Optimized release build.",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
"binaryDir": "${sourceDir}/build/release-clang",
|
"binaryDir": "${sourceDir}/build/release-clang",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": {
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
"type": "STRING",
|
}
|
||||||
"value": "Release"
|
},
|
||||||
}
|
{
|
||||||
|
"name": "build-debug-clang-cl",
|
||||||
|
"inherits": [
|
||||||
|
"base",
|
||||||
|
"win32-unicode",
|
||||||
|
"x64",
|
||||||
|
"clang-cl"
|
||||||
|
],
|
||||||
|
"displayName": "Debug (Clang)",
|
||||||
|
"description": "Debug build for testing.",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build/debug-clang",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -201,52 +158,5 @@
|
|||||||
"configurePreset": "build-debug-clang-cl",
|
"configurePreset": "build-debug-clang-cl",
|
||||||
"description": "Debug build for testing."
|
"description": "Debug build for testing."
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"testPresets": [
|
|
||||||
{
|
|
||||||
"name": "tests-all",
|
|
||||||
"displayName": "All Tests",
|
|
||||||
"configurePreset": "build-debug-msvc",
|
|
||||||
"output": {
|
|
||||||
"outputOnFailure": true
|
|
||||||
},
|
|
||||||
"execution": {
|
|
||||||
"noTestsAction": "error",
|
|
||||||
"stopOnFailure": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "tests-unit",
|
|
||||||
"displayName": "Unit Tests",
|
|
||||||
"description": "Runs tests that do not require any Skyrim module loaded into the process.",
|
|
||||||
"inherits": "tests-all",
|
|
||||||
"filter": {
|
|
||||||
"exclude": {
|
|
||||||
"label": "[integration],[e2e]"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "tests-integration",
|
|
||||||
"displayName": "Integration Tests",
|
|
||||||
"description": "Runs tests that interact with a Skyrim module at rest (do not require the Skyrim module to have run any main function).",
|
|
||||||
"inherits": "tests-all",
|
|
||||||
"filter": {
|
|
||||||
"include": {
|
|
||||||
"label": "[integration]"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "tests-e2e",
|
|
||||||
"displayName": "End-to-End Tests",
|
|
||||||
"description": "Runs test that depend on a fully running Skyrim engine in the process.",
|
|
||||||
"inherits": "tests-all",
|
|
||||||
"filter": {
|
|
||||||
"include": {
|
|
||||||
"label": "[e2e]"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
56
Source/ArtifactTrackerDLL/README.md
Normal file
56
Source/ArtifactTrackerDLL/README.md
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# Artifact Tracker DLL — building
|
||||||
|
|
||||||
|
The plugin builds against a **pinned CommonLibSSE-NG** pulled in with CMake
|
||||||
|
`FetchContent`. There is no vcpkg dependency: everything is fetched from source
|
||||||
|
at configure time, so the same `CMakePresets.json` drives both the command line
|
||||||
|
and Visual Studio.
|
||||||
|
|
||||||
|
## Command line
|
||||||
|
|
||||||
|
```cmd
|
||||||
|
build.cmd :: release-msvc (default)
|
||||||
|
build.cmd debug-msvc
|
||||||
|
```
|
||||||
|
|
||||||
|
`build.cmd` locates Visual Studio via `vswhere`, imports the MSVC x64
|
||||||
|
environment (`vcvars64.bat` — the part VS sets up for you automatically), then
|
||||||
|
runs the preset:
|
||||||
|
|
||||||
|
```cmd
|
||||||
|
cmake --preset build-release-msvc
|
||||||
|
cmake --build --preset release-msvc
|
||||||
|
```
|
||||||
|
|
||||||
|
The built `ArtifactTracker.dll` is copied to `../../SKSE/Plugins/`.
|
||||||
|
|
||||||
|
## Visual Studio
|
||||||
|
|
||||||
|
Open the `Source/ArtifactTrackerDLL` folder (File ▸ Open ▸ Folder). VS reads
|
||||||
|
`CMakePresets.json`, configures the MSVC environment itself, and builds with the
|
||||||
|
same presets. No extra setup.
|
||||||
|
|
||||||
|
## Dependencies (pinned, fetched automatically)
|
||||||
|
|
||||||
|
| Dependency | Pin | Why |
|
||||||
|
|-------------------|----------------|-----|
|
||||||
|
| CommonLibSSE-NG | `alandtse/CommonLibVR` @ `aacbd76` | SKSE API (SE/AE/VR) |
|
||||||
|
| DirectXTK / DirectXMath | jul2025 / apr2025 | required by CommonLibVR |
|
||||||
|
| rapidcsv | v8.90 | required by CommonLibVR |
|
||||||
|
| spdlog | v1.17.0 | logging (also used directly) |
|
||||||
|
| simpleini | v4.25 | reads `ArtifactTracker.ini` |
|
||||||
|
|
||||||
|
## Note: the DirectXTK shader patch
|
||||||
|
|
||||||
|
`cmake/patch_directxtk.cmake` is applied to DirectXTK via `FetchContent`
|
||||||
|
`PATCH_COMMAND`. DirectXTK compiles its HLSL shaders by running
|
||||||
|
`cmake -E env … CompileShaders.cmd` with a **bare** script name, relying on the
|
||||||
|
current directory being on the executable search path.
|
||||||
|
|
||||||
|
That only holds when `NoDefaultCurrentDirectoryInExePath` is **unset** — which is
|
||||||
|
the case inside Visual Studio's build environment, but **not** in a hardened
|
||||||
|
command-line shell that sets it (there, `cmake -E env` refuses to look in the
|
||||||
|
current directory and the step fails with "no such file or directory"). The
|
||||||
|
patch rewrites that one invocation to an absolute path so shaders compile
|
||||||
|
regardless of the environment. Removing it will break command-line builds while
|
||||||
|
still "working" in Visual Studio. The patch is idempotent and only touches the
|
||||||
|
shader command line.
|
||||||
43
Source/ArtifactTrackerDLL/build.cmd
Normal file
43
Source/ArtifactTrackerDLL/build.cmd
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
@echo off
|
||||||
|
rem ---------------------------------------------------------------------------
|
||||||
|
rem Command-line build wrapper.
|
||||||
|
rem
|
||||||
|
rem Sets up the MSVC x64 environment (the piece Visual Studio configures for you
|
||||||
|
rem automatically) and then drives the exact same CMake presets that Visual
|
||||||
|
rem Studio uses, so both build paths stay in sync.
|
||||||
|
rem
|
||||||
|
rem Usage: build.cmd [preset]
|
||||||
|
rem preset defaults to "release-msvc". Other options: debug-msvc,
|
||||||
|
rem release-clang-cl, debug-clang-cl (must match a name in CMakePresets.json).
|
||||||
|
rem ---------------------------------------------------------------------------
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
set "PRESET=%~1"
|
||||||
|
if "%PRESET%"=="" set "PRESET=release-msvc"
|
||||||
|
set "CONFIGURE_PRESET=build-%PRESET%"
|
||||||
|
|
||||||
|
cd /d "%~dp0"
|
||||||
|
|
||||||
|
rem --- Locate Visual Studio (or the C++ Build Tools) ---
|
||||||
|
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||||
|
if not exist "%VSWHERE%" (
|
||||||
|
echo [ERROR] vswhere.exe not found. Install Visual Studio 2022 or the C++ Build Tools.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
set "VSINSTALL="
|
||||||
|
for /f "usebackq delims=" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSINSTALL=%%i"
|
||||||
|
if not defined VSINSTALL (
|
||||||
|
echo [ERROR] No Visual Studio installation with the C++ toolset was found.
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
rem --- Import the MSVC x64 developer environment ---
|
||||||
|
call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" || exit /b 1
|
||||||
|
|
||||||
|
rem --- Configure and build using the shared presets ---
|
||||||
|
cmake --preset %CONFIGURE_PRESET% || exit /b 1
|
||||||
|
cmake --build --preset %PRESET% || exit /b 1
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo [OK] Built preset "%PRESET%". Plugin deployed to SKSE\Plugins\.
|
||||||
23
Source/ArtifactTrackerDLL/cmake/patch_directxtk.cmake
Normal file
23
Source/ArtifactTrackerDLL/cmake/patch_directxtk.cmake
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Patch applied to DirectXTK's CMakeLists.txt via FetchContent PATCH_COMMAND.
|
||||||
|
#
|
||||||
|
# DirectXTK compiles its HLSL shaders by running Src/Shaders/CompileShaders.cmd
|
||||||
|
# through `cmake -E env ... CompileShaders.cmd` (a bare script name, relying on
|
||||||
|
# the custom command's WORKING_DIRECTORY). Modern CMake no longer resolves a
|
||||||
|
# bare command name against the working directory, so the step fails with
|
||||||
|
# "no such file or directory" and the whole build stops.
|
||||||
|
#
|
||||||
|
# Rewrite that single invocation to an absolute path. WORKING_DIRECTORY is left
|
||||||
|
# untouched so the script still runs with Src/Shaders as its CWD. The replace is
|
||||||
|
# idempotent: after patching, the original "CompileShaders.cmd ARGS" substring is
|
||||||
|
# gone, so re-running the patch is a no-op. It also targets only the COMMAND line
|
||||||
|
# (the MAIN_DEPENDENCY reference already uses a full path and is not matched).
|
||||||
|
set(_dxtk_cmakelists "CMakeLists.txt")
|
||||||
|
|
||||||
|
file(READ "${_dxtk_cmakelists}" _dxtk_content)
|
||||||
|
string(REPLACE
|
||||||
|
"CompileShaders.cmd ARGS"
|
||||||
|
"\"\${PROJECT_SOURCE_DIR}/Src/Shaders/CompileShaders.cmd\" ARGS"
|
||||||
|
_dxtk_content "${_dxtk_content}")
|
||||||
|
file(WRITE "${_dxtk_cmakelists}" "${_dxtk_content}")
|
||||||
|
|
||||||
|
message(STATUS "Patched DirectXTK CompileShaders.cmd invocation to use an absolute path.")
|
||||||
@ -1,8 +0,0 @@
|
|||||||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
|
||||||
set(VCPKG_CRT_LINKAGE dynamic)
|
|
||||||
|
|
||||||
if (${PORT} MATCHES "fully-dynamic-game-engine|skse|qt*")
|
|
||||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
|
||||||
else ()
|
|
||||||
set(VCPKG_LIBRARY_LINKAGE static)
|
|
||||||
endif ()
|
|
||||||
@ -225,9 +225,9 @@ namespace ArtifactTracker
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_persistentMap.clear();
|
g_persistentMap.clear();
|
||||||
g_persistentStorage->ForEachForm([&](RE::TESForm& a_exform) {
|
g_persistentStorage->ForEachForm([&](RE::TESForm* a_exform) {
|
||||||
if (&a_exform) {
|
if (a_exform) {
|
||||||
g_persistentMap[a_exform.formID] = a_exform.As<RE::TESObjectREFR>();
|
g_persistentMap[a_exform->formID] = a_exform->As<RE::TESObjectREFR>();
|
||||||
}
|
}
|
||||||
return RE::BSContainer::ForEachResult::kContinue;
|
return RE::BSContainer::ForEachResult::kContinue;
|
||||||
});
|
});
|
||||||
@ -400,8 +400,8 @@ namespace ArtifactTracker
|
|||||||
RE::TESObjectREFR* cellStorage = nullptr;
|
RE::TESObjectREFR* cellStorage = nullptr;
|
||||||
bool bHasDupes = false;
|
bool bHasDupes = false;
|
||||||
|
|
||||||
g_persistentStorage->ForEachForm([&](RE::TESForm& a_form) {
|
g_persistentStorage->ForEachForm([&](RE::TESForm* a_form) {
|
||||||
const auto refr = a_form.As<RE::TESObjectREFR>();
|
const auto refr = a_form->As<RE::TESObjectREFR>();
|
||||||
if (refr && refr->GetParentCell()->formID == a_formID && refr->GetBaseObject() == g_cellContainer) {
|
if (refr && refr->GetParentCell()->formID == a_formID && refr->GetBaseObject() == g_cellContainer) {
|
||||||
if (cellStorage) {
|
if (cellStorage) {
|
||||||
log::warn("Multiple cell storages detected in {}", cell->GetName());
|
log::warn("Multiple cell storages detected in {}", cell->GetName());
|
||||||
@ -443,12 +443,12 @@ namespace ArtifactTracker
|
|||||||
RE::TESObjectREFR* cellStorage = nullptr;
|
RE::TESObjectREFR* cellStorage = nullptr;
|
||||||
std::vector<RE::TESObjectREFR*> dupes;
|
std::vector<RE::TESObjectREFR*> dupes;
|
||||||
|
|
||||||
cell->ForEachReference([&cellStorage, &dupes](RE::TESObjectREFR& a_ref) {
|
cell->ForEachReference([&cellStorage, &dupes](RE::TESObjectREFR* a_ref) {
|
||||||
if (a_ref.GetBaseObject() == g_cellContainer && !a_ref.IsMarkedForDeletion()) {
|
if (a_ref->GetBaseObject() == g_cellContainer && !a_ref->IsMarkedForDeletion()) {
|
||||||
if (cellStorage) {
|
if (cellStorage) {
|
||||||
dupes.push_back(&a_ref);
|
dupes.push_back(a_ref);
|
||||||
} else {
|
} else {
|
||||||
cellStorage = &a_ref;
|
cellStorage = a_ref;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return RE::BSContainer::ForEachResult::kContinue;
|
return RE::BSContainer::ForEachResult::kContinue;
|
||||||
@ -520,19 +520,19 @@ namespace ArtifactTracker
|
|||||||
const auto cell = g_cellStorage->GetParentCell();
|
const auto cell = g_cellStorage->GetParentCell();
|
||||||
const auto inv = g_cellStorage->GetInventory();
|
const auto inv = g_cellStorage->GetInventory();
|
||||||
|
|
||||||
cell->ForEachReference([&](RE::TESObjectREFR& a_ref) {
|
cell->ForEachReference([&](RE::TESObjectREFR* a_ref) {
|
||||||
if (ignoreFormID && ignoreFormID == a_ref.formID) {
|
if (ignoreFormID && ignoreFormID == a_ref->formID) {
|
||||||
return RE::BSContainer::ForEachResult::kContinue;
|
return RE::BSContainer::ForEachResult::kContinue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto baseObj = a_ref.GetBaseObject();
|
const auto baseObj = a_ref->GetBaseObject();
|
||||||
|
|
||||||
if (IsValidContainer(&a_ref)) {
|
if (IsValidContainer(a_ref)) {
|
||||||
if (g_cellContainer == baseObj || baseObj->formID == 0xDC9E7 || g_persistentMap.contains(a_ref.formID)) { // skip persistent and PlayerBookShelfContainer
|
if (g_cellContainer == baseObj || baseObj->formID == 0xDC9E7 || g_persistentMap.contains(a_ref->formID)) { // skip persistent and PlayerBookShelfContainer
|
||||||
return RE::BSContainer::ForEachResult::kContinue;
|
return RE::BSContainer::ForEachResult::kContinue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto contInv = a_ref.GetInventory([&](RE::TESBoundObject& a_object) -> bool {
|
const auto contInv = a_ref->GetInventory([&](RE::TESBoundObject& a_object) -> bool {
|
||||||
return !cellItems.contains(a_object.formID) && g_artifactAllFormTypes.contains(a_object.GetFormType());
|
return !cellItems.contains(a_object.formID) && g_artifactAllFormTypes.contains(a_object.GetFormType());
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -553,7 +553,7 @@ namespace ArtifactTracker
|
|||||||
return RE::BSContainer::ForEachResult::kContinue;
|
return RE::BSContainer::ForEachResult::kContinue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_artifactAllFormTypes.contains(baseObj->GetFormType()) || a_ref.IsDisabled() || a_ref.IsMarkedForDeletion() || cellItems.contains(baseObj->formID)) {
|
if (!g_artifactAllFormTypes.contains(baseObj->GetFormType()) || a_ref->IsDisabled() || a_ref->IsMarkedForDeletion() || cellItems.contains(baseObj->formID)) {
|
||||||
return RE::BSContainer::ForEachResult::kContinue;
|
return RE::BSContainer::ForEachResult::kContinue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -810,8 +810,8 @@ namespace ArtifactTracker
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (a_refOrList->Is(RE::FormType::FormList)) {
|
if (a_refOrList->Is(RE::FormType::FormList)) {
|
||||||
a_refOrList->As<RE::BGSListForm>()->ForEachForm([&](RE::TESForm& a_exform) {
|
a_refOrList->As<RE::BGSListForm>()->ForEachForm([&](RE::TESForm* a_exform) {
|
||||||
const auto refrItem = a_exform.As<RE::TESObjectREFR>();
|
const auto refrItem = a_exform->As<RE::TESObjectREFR>();
|
||||||
if (refrItem) {
|
if (refrItem) {
|
||||||
AddRefArtifactsToList(refrItem, a_targetList, a_excludeList);
|
AddRefArtifactsToList(refrItem, a_targetList, a_excludeList);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,8 +100,8 @@ inline bool RefListHasItem(RE::TESForm* a_refOrList, RE::FormID a_formID)
|
|||||||
|
|
||||||
if (list) {
|
if (list) {
|
||||||
bool bResult = false;
|
bool bResult = false;
|
||||||
list->ForEachForm([&](RE::TESForm& a_form) {
|
list->ForEachForm([&](RE::TESForm* a_form) {
|
||||||
if (&a_form && RefListHasItem(&a_form, a_formID)) {
|
if (a_form && RefListHasItem(a_form, a_formID)) {
|
||||||
bResult = true;
|
bResult = true;
|
||||||
return RE::BSContainer::ForEachResult::kStop;
|
return RE::BSContainer::ForEachResult::kStop;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"registries": [
|
|
||||||
{
|
|
||||||
"kind": "git",
|
|
||||||
"repository": "https://gitlab.com/colorglass/vcpkg-colorglass",
|
|
||||||
"baseline": "6309841a1ce770409708a67a9ba5c26c537d2937",
|
|
||||||
"packages": [
|
|
||||||
"commonlibsse-ng",
|
|
||||||
"gluino",
|
|
||||||
"script-extender-common",
|
|
||||||
"skse"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
|
|
||||||
"name": "artifact-tracker",
|
|
||||||
"version-string": "1.0.11",
|
|
||||||
"port-version": 0,
|
|
||||||
"description": "Artifact Tracker",
|
|
||||||
"homepage": "https://mod.pub/skyrim-se/36-artifact-tracker",
|
|
||||||
"license": null,
|
|
||||||
"features": {
|
|
||||||
"plugin": {
|
|
||||||
"description": "Tracks found and stored artifacts.",
|
|
||||||
"dependencies": [
|
|
||||||
"commonlibsse-ng",
|
|
||||||
"simpleini"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"default-features": [
|
|
||||||
"plugin"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user