[SDL2] On Win, build and link statically.

Keep using system lib dynamically on Unix.
This commit is contained in:
Joel Linn
2020-03-30 13:23:25 +02:00
committed by Rick Gibbed
parent 9828e085b0
commit 804384c19c
12 changed files with 391 additions and 40 deletions

View File

@@ -79,7 +79,6 @@ project("xenia-app")
filter("platforms:Windows")
links({
"delayimp", -- This library implements delayed loading on Windows, an MSVC exclusive feature.
"xenia-apu-xaudio2",
"xenia-gpu-d3d12",
"xenia-hid-winkey",
@@ -87,11 +86,6 @@ project("xenia-app")
"xenia-ui-d3d12",
})
filter("platforms:Windows")
linkoptions({
"/DELAYLOAD:SDL2.dll", -- SDL is not mandatory on Windows, implementations using native APIs are prefered.
})
filter("platforms:Windows")
-- Only create the .user file if it doesn't already exist.
local user_file = project_root.."/build/xenia-app.vcxproj.user"

View File

@@ -14,16 +14,4 @@ project("xenia-apu-sdl")
defines({
})
local_platform_files()
filter("platforms:Windows")
-- On linux we build against the system version (libsdl2-dev)
includedirs({
project_root.."/third_party/SDL2-devel-VC/include/",
})
libdirs({
project_root.."/third_party/SDL2-devel-VC/lib/x64/",
})
-- Copy the dll to the output folder
postbuildcommands({
"{COPY} %{prj.basedir}/"..project_root.."/third_party/SDL2-devel-VC/lib/x64/SDL2.dll %{cfg.targetdir}",
})
sdl2_include()

View File

@@ -9,12 +9,12 @@
#ifndef XENIA_APU_SDL_SDL_AUDIO_DRIVER_H_
#define XENIA_APU_SDL_SDL_AUDIO_DRIVER_H_
#include <SDL2/SDL.h>
#include <mutex>
#include <queue>
#include <stack>
#include "SDL.h"
#include "xenia/apu/audio_driver.h"
#include "xenia/base/threading.h"

View File

@@ -15,16 +15,4 @@ project("xenia-hid-sdl")
defines({
})
local_platform_files()
filter("platforms:Windows")
-- On linux we build against the system version (libsdl2-dev)
includedirs({
project_root.."/third_party/SDL2-devel-VC/include/",
})
libdirs({
project_root.."/third_party/SDL2-devel-VC/lib/x64/",
})
-- Copy the dll to the output folder
postbuildcommands({
"{COPY} %{prj.basedir}/"..project_root.."/third_party/SDL2-devel-VC/lib/x64/SDL2.dll %{cfg.targetdir}",
})
sdl2_include()

View File

@@ -10,12 +10,11 @@
#ifndef XENIA_HID_SDL_SDL_INPUT_DRIVER_H_
#define XENIA_HID_SDL_SDL_INPUT_DRIVER_H_
#include <SDL2/SDL.h>
#include <array>
#include <atomic>
#include <mutex>
#include "SDL.h"
#include "xenia/hid/input_driver.h"
#define HID_SDL_USER_COUNT (4)