using static for windows

This commit is contained in:
2026-05-04 04:02:19 +03:00
parent 77b0ed3c81
commit 0215b7e0b7
7 changed files with 28 additions and 26 deletions

View File

@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.26)
file(READ VERSION OMATH_VERSION)
project(omath VERSION ${OMATH_VERSION} LANGUAGES CXX)

View File

@@ -56,7 +56,9 @@
"hidden": true,
"inherits": ["windows-base", "vcpkg-base"],
"cacheVariables": {
"VCPKG_MANIFEST_FEATURES": "tests;imgui;avx2;examples"
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"VCPKG_MANIFEST_FEATURES": "tests;imgui;avx2;examples;hooking",
"OMATH_STATIC_MSVC_RUNTIME_LIBRARY": "ON"
}
},
{
@@ -89,9 +91,10 @@
"strategy": "external"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x86-windows",
"VCPKG_TARGET_TRIPLET": "x86-windows-static",
"VCPKG_HOST_TRIPLET": "x64-windows",
"VCPKG_MANIFEST_FEATURES": "tests;imgui;avx2;examples"
"VCPKG_MANIFEST_FEATURES": "tests;imgui;avx2;examples",
"OMATH_STATIC_MSVC_RUNTIME_LIBRARY": "ON"
}
},
{
@@ -114,9 +117,10 @@
"strategy": "external"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "arm64-windows",
"VCPKG_HOST_TRIPLET": "arm64-windows",
"VCPKG_MANIFEST_FEATURES": "tests;imgui;examples"
"VCPKG_TARGET_TRIPLET": "arm64-windows-static",
"VCPKG_HOST_TRIPLET": "arm64-windows-static",
"VCPKG_MANIFEST_FEATURES": "tests;imgui;examples",
"OMATH_STATIC_MSVC_RUNTIME_LIBRARY": "ON"
}
},
{

View File

@@ -4,6 +4,7 @@ add_library(${PROJECT_NAME} SHARED dllmain.cpp)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 23
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}")

View File

@@ -1,9 +1,10 @@
project(example_dx12_hook)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_library(${PROJECT_NAME} MODULE dllmain.cpp)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 23
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}")

View File

@@ -5,6 +5,7 @@
#include <imgui.h>
#include <imgui_impl_dx12.h>
#include <imgui_impl_win32.h>
#include <tuple>
#include <vector>
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND, UINT, WPARAM, LPARAM);
@@ -230,7 +231,7 @@ BOOL WINAPI DllMain(HINSTANCE h_instance, DWORD reason, LPVOID)
auto& mgr = omath::hooks::HooksManager::get();
mgr.set_on_present(on_present);
mgr.set_on_execute_command_lists(on_execute_command_lists);
mgr.hook_dx12();
std::ignore = mgr.hook_dx12();
return 0;
},
nullptr, 0, nullptr);

View File

@@ -1,9 +1,10 @@
project(example_dx9_hook)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_library(${PROJECT_NAME} MODULE dllmain.cpp)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 23
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}")

View File

@@ -42,30 +42,25 @@
],
"supports": "(windows | linux) & !arm & !uwp"
},
"hooking-examples": {
"description": "ImGui overlay examples for DX9/DX11/DX12 hooking (requires hooking feature)",
"dependencies": [
{
"name": "omath",
"features": ["hooking"]
},
{
"name": "imgui",
"features": ["dx9-binding", "dx11-binding", "dx12-binding", "win32-binding"],
"default-features": false
}
],
"supports": "windows & !arm & !uwp"
},
"examples": {
"description": "Build examples",
"dependencies": [
"glfw3",
"glew",
"opengl",
{
"name": "omath",
"features": ["hooking"],
"platform": "windows & !arm & !uwp"
},
{
"name": "imgui",
"features": ["glfw-binding", "opengl3-binding", "dx12-binding", "dx9-binding", "dx11-binding", "win32-binding"]
"features": ["glfw-binding", "opengl3-binding"]
},
{
"name": "imgui",
"features": ["dx9-binding", "dx11-binding", "dx12-binding", "win32-binding"],
"platform": "windows & !arm & !uwp"
}
]
},