Fix MSVC build again, add support for standalone MSVC compiler (#59)

After switching away from VS, I realized the buildscript wouldn't detect the standalone MSVC compiler, because for whatever genius reason, MS installs that in the x86 program files directory...

Also fixes some duplicate definitions and a missing library that MSVC doesn't like
ah compilers...

Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/59
Co-authored-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
Co-committed-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
pull/60/head
kyoubate-haruka 2025-02-24 18:49:22 +00:00 committed by Dniel97
parent 004a2f6dcd
commit efe01d92a6
7 changed files with 10 additions and 7 deletions

3
.gitignore vendored
View File

@ -21,3 +21,6 @@ subprojects/capnhook
# For enabling debug logging on local builds
MesonLocalOptions.mk
# Some meson cache thing
.meson-subproject-wrap-hash.txt

View File

@ -1,5 +1,4 @@
#include <windows.h>
#include <ntstatus.h>
#include <winioctl.h>
#include <assert.h>

View File

@ -4,6 +4,7 @@ hooklib_lib = static_library(
implicit_include_directories : false,
dependencies : [
capnhook.get_variable('hook_dep'),
Ws2_32_lib
],
sources : [
'cursor.c',

View File

@ -83,6 +83,7 @@ dxguid_lib = cc.find_library('dxguid')
xinput_lib = cc.find_library('xinput')
pathcch_lib = cc.find_library('pathcch')
imagehlp_lib = cc.find_library('imagehlp')
Ws2_32_lib = cc.find_library('Ws2_32')
inc = include_directories('.')
capnhook = subproject('capnhook')

View File

@ -52,17 +52,16 @@ exit /b
rem This should works for Visual Studio 2017+
:detect-visual-studio (
rem Who the hell on earth is still using a 32bit Windows in 2024
if "%ProgramFiles(x86)%"=="" (
set VSWHERE="%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
) else (
rem Fall back to x86 program directory for MSVC standalone if it can't be found in x64, because even though it's x64 compilers, they install in x86 program files for whatever dumb reason
set VSWHERE="%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist %VSWHERE% (
set VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
)
if exist %VSWHERE% (
REM get vcvarsall by using vswhere
set VSVARSALL=""
for /f "tokens=* usebackq" %%i in (`%VSWHERE% -find VC\Auxiliary\Build\vcvarsall.bat`) do set VSVARSALL="%%i"
for /f "tokens=* usebackq" %%i in (`%VSWHERE% -products * -find VC\Auxiliary\Build\vcvarsall.bat`) do set VSVARSALL="%%i"
) else (
REM fallback to old method
set VSVARSALL="%VS_INSTALLATION%\VC\Auxiliary\Build\vcvarsall.bat"

View File

@ -1,5 +1,4 @@
#include <windows.h>
#include <ntstatus.h>
#include <assert.h>
#include <stdlib.h>

View File

@ -5,6 +5,7 @@
// https://github.com/NeighTools/UnityDoorstop
#include <stdbool.h>
#include <stdlib.h>
#include <windows.h>
#include <wchar.h>
#include <pathcch.h>