From 0e991a7bb4e982f56e1157599b2a380fe2e397bb Mon Sep 17 00:00:00 2001 From: Janis Date: Thu, 11 Aug 2022 09:32:58 +0200 Subject: [PATCH] initial commit --- .gitmodules | 3 +++ Detours | 1 + build.zig | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 .gitmodules create mode 160000 Detours create mode 100644 build.zig diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..126a45a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Detours"] + path = Detours + url = https://github.com/microsoft/Detours.git diff --git a/Detours b/Detours new file mode 160000 index 0000000..24357c6 --- /dev/null +++ b/Detours @@ -0,0 +1 @@ +Subproject commit 24357c6a5a6bb9025a71050e50b38dbe9c02713a diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..bc34af2 --- /dev/null +++ b/build.zig @@ -0,0 +1,28 @@ +const std = @import("std"); + +pub fn build(b: *std.build.Builder) void { + const target = b.standardTargetOptions(.{}); + const mode = std.builtin.Mode.ReleaseSafe; + + std.debug.assert(target.isWindows()); + + const detours = b.addStaticLibrary("detours", null); + detours.setTarget(target); + detours.setBuildMode(mode); + detours.linkLibC(); + detours.linkLibCpp(); + detours.force_pic = true; + detours.install(); + detours.addIncludeDir("./Detours/src/"); + detours.addCSourceFiles(&.{ + "Detours/src/detours.cpp", + "Detours/src/modules.cpp", + "Detours/src/disasm.cpp", + "Detours/src/image.cpp", + "Detours/src/disolx86.cpp", + "Detours/src/disolx64.cpp", + "Detours/src/disolia64.cpp", + "Detours/src/disolarm.cpp", + "Detours/src/disolarm64.cpp", + }, &.{"-Wall", "-DWIN32_LEAN_AND_MEAN", "-DDETOURS_VERSION=0x4c0c1", "-std=c++14"}); +}