! switched from sdl2 to sdl3, building sdl3 from source
This commit is contained in:
37
premake5.lua
37
premake5.lua
@@ -14,12 +14,14 @@ workspace "SakuraVNE"
|
||||
IncludeDir = {}
|
||||
IncludeDir["ImGui"] = "/libs/imgui"
|
||||
IncludeDir["ImGuiNodeEditor"] = "/libs/imgui-node-editor"
|
||||
IncludeDir["SDL3"] = "/libs/sdl3"
|
||||
|
||||
include "libs/imgui"
|
||||
include "libs/imgui-node-editor"
|
||||
--include "libs/sdl3"
|
||||
|
||||
project "SakuraVNE" --project under solution
|
||||
location "SakuraVNE"
|
||||
--location "SakuraVNE"
|
||||
kind "ConsoleApp"
|
||||
language "C++"
|
||||
cppdialect "C++20"
|
||||
@@ -29,6 +31,23 @@ project "SakuraVNE" --project under solution
|
||||
targetdir ("build/bin/" .. outputdir .. "/%{prj.name}")
|
||||
objdir ("build/bin-int/" ..outputdir .. "/%{prj.name}")
|
||||
|
||||
-- Capture the absolute path to your project root.
|
||||
-- (We also replace \ with / to ensure it works flawlessly if you ever build on Windows)
|
||||
local root_path = os.getcwd():gsub("\\", "/")
|
||||
|
||||
prebuildcommands {
|
||||
"echo ==== Building SDL3 via CMake ====",
|
||||
|
||||
"mkdir -p \"" .. root_path .. "/build/bin/" .. outputdir .. "/SDL3\"",
|
||||
|
||||
"cmake -S libs/sdl3 -B \"" .. root_path .. "/build/bin-int/" .. outputdir .. "/SDL3\" -DCMAKE_BUILD_TYPE=Release " ..
|
||||
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=\"" .. root_path .. "/build/bin/" .. outputdir .. "/SDL3\" " ..
|
||||
"-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=\"" .. root_path .. "/build/bin/" .. outputdir .. "/SDL3\" " ..
|
||||
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=\"" .. root_path .. "/build/bin/" .. outputdir .. "/SDL3\"",
|
||||
|
||||
"cmake --build \"" .. root_path .. "/build/bin-int/" .. outputdir .. "/SDL3\" --config Release -j"
|
||||
}
|
||||
|
||||
files{
|
||||
"%{prj.name}/src/**.h",
|
||||
"%{prj.name}/src/**.cpp"
|
||||
@@ -40,17 +59,20 @@ project "SakuraVNE" --project under solution
|
||||
"libs/imgui",
|
||||
"libs/imgui/misc",
|
||||
"libs/imgui/backends",
|
||||
"libs/imgui-node-editor"
|
||||
"libs/imgui-node-editor",
|
||||
"libs/sdl3/include"
|
||||
}
|
||||
|
||||
libdirs{
|
||||
"build/bin/" .. outputdir .. "/ImGui",
|
||||
"build/bin/" .. outputdir .. "/ImGuiNodeEditor"
|
||||
"build/bin/" .. outputdir .. "/ImGuiNodeEditor",
|
||||
"build/bin/" .. outputdir .. "/SDL3"
|
||||
}
|
||||
|
||||
links{
|
||||
"ImGui",
|
||||
"ImGuiNodeEditor"
|
||||
"ImGuiNodeEditor",
|
||||
"SDL3"
|
||||
}
|
||||
|
||||
filter "system:windows"
|
||||
@@ -89,15 +111,10 @@ project "SakuraVNE" --project under solution
|
||||
defines{
|
||||
"PLATFORM_LINUX"
|
||||
}
|
||||
|
||||
includedirs{
|
||||
"/usr/include/SDL2"
|
||||
}
|
||||
|
||||
-- TELL THE LINKER TO USE SYSTEM LIBS
|
||||
links {
|
||||
"SDL2",
|
||||
"GL", -- OpenGL is usually required for ImGui/SDL apps
|
||||
--"GL", -- OpenGL is usually required for ImGui/SDL apps
|
||||
"dl", -- Dynamic linking loader (often needed)
|
||||
"pthread" -- POSIX threads (often needed)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user