From c375d9ba671013bd8993c18305976a75eb7639f7 Mon Sep 17 00:00:00 2001 From: trompetin17 Date: Mon, 2 Jun 2025 12:12:55 -0500 Subject: [PATCH] Add SDL2 linking configuration to premake --- build/premake/extern_libs5.lua | 9 +++++++++ source/lib/external_libraries/libsdl.h | 7 +------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build/premake/extern_libs5.lua b/build/premake/extern_libs5.lua index b9444b8d6c..17301b3295 100644 --- a/build/premake/extern_libs5.lua +++ b/build/premake/extern_libs5.lua @@ -627,6 +627,15 @@ extern_lib_defs = { link_settings = function() if os.istarget("windows") then add_default_lib_paths("sdl2") + add_default_links({ + win_names = { "SDL2", "SDL2main" }, + no_delayload = 1, + }) + + -- SDL2maind.pdb dont provide debug info, so we ignore the warning + filter { "system:windows", "configurations:Debug" } + linkoptions { "/IGNORE:4099" } + filter{} elseif not _OPTIONS["android"] then pkgconfig.add_links("sdl2") end diff --git a/source/lib/external_libraries/libsdl.h b/source/lib/external_libraries/libsdl.h index 6ba1255562..8aee8c494d 100644 --- a/source/lib/external_libraries/libsdl.h +++ b/source/lib/external_libraries/libsdl.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -43,11 +43,6 @@ // another header that toggles between wsdl and SDL_endian.h. # include "SDL_endian.h" -# if MSC_VERSION -# pragma comment(lib, "SDL2") -# pragma comment(lib, "SDL2main") -# endif - // complete definition of our forward-declared SDL_Event (see sdl_fwd.h) struct SDL_Event_ {