139 lines
4.0 KiB
Lua
139 lines
4.0 KiB
Lua
require "plugins/ecc"
|
|
|
|
workspace "SakuraVNE"
|
|
architecture "x64"
|
|
startproject "SakuraVNE"
|
|
|
|
configurations{
|
|
"Debug",
|
|
"Release"
|
|
}
|
|
|
|
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
|
|
|
|
IncludeDir = {}
|
|
IncludeDir["ImGui"] = "/libs/imgui"
|
|
IncludeDir["ImGuiNodeEditor"] = "/libs/imgui-node-editor"
|
|
IncludeDir["SDL3"] = "/libs/sdl3"
|
|
IncludeDir["spdlog"] = "/libs/spdlog"
|
|
|
|
include "libs/imgui"
|
|
include "libs/imgui-node-editor"
|
|
|
|
project "SakuraVNE" --project under solution
|
|
--location "SakuraVNE"
|
|
kind "ConsoleApp"
|
|
language "C++"
|
|
cppdialect "C++20"
|
|
|
|
ignoredefaultlibraries { "MSVCRT" }
|
|
|
|
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"
|
|
}
|
|
|
|
prebuildcommands{
|
|
"echo ==== Building spdlog via CMake ====",
|
|
"mkdir -p \"" .. root_path .. "/build/bin/" ..outputdir .. "/spdlog\"",
|
|
"cmake -S libs/spdlog -B \"" .. root_path .. "/build/bin-int/" ..outputdir .. "/spdlog\" -DCMAKE_BUILD_TYPE=Release",
|
|
"cmake --build \"" .. root_path .. "/build/bin-int/" ..outputdir .. "/spdlog\"",
|
|
"cp \"" .. root_path .. "/build/bin-int/" .. outputdir .. "/spdlog/\"libspdlog* \"" .. root_path .. "/build/bin/" .. outputdir .. "/spdlog/\""
|
|
}
|
|
|
|
files{
|
|
"%{prj.name}/src/**.h",
|
|
"%{prj.name}/src/**.cpp"
|
|
}
|
|
|
|
includedirs{
|
|
"%{prj.name}/src",
|
|
"libs/spdlog/include",
|
|
"libs/imgui",
|
|
"libs/imgui/misc",
|
|
"libs/imgui/backends",
|
|
"libs/imgui-node-editor",
|
|
"libs/sdl3/include"
|
|
}
|
|
|
|
libdirs{
|
|
"build/bin/" .. outputdir .. "/ImGui",
|
|
"build/bin/" .. outputdir .. "/ImGuiNodeEditor",
|
|
"build/bin/" .. outputdir .. "/SDL3",
|
|
"build/bin/" .. outputdir .. "/spdlog"
|
|
}
|
|
|
|
links{
|
|
"ImGui",
|
|
"ImGuiNodeEditor",
|
|
"SDL3",
|
|
"spdlog"
|
|
}
|
|
|
|
filter "system:windows"
|
|
system "windows"
|
|
cppdialect "C++20"
|
|
staticruntime "off"
|
|
runtime "Release"
|
|
systemversion "latest"
|
|
|
|
defines{
|
|
"PLATFORM_WINDOWS"
|
|
}
|
|
|
|
includedirs{
|
|
"libs/sdl/windows/include"
|
|
}
|
|
links {
|
|
"SDL2",
|
|
"SDL2main"
|
|
}
|
|
libdirs{
|
|
"libs/sdl/windows/lib/x64/"
|
|
}
|
|
|
|
postbuildcommands{
|
|
("{COPY} libs/sdl/windows/lib/x64/SDL2.dll %{cfg.buildtarget.directory}")
|
|
}
|
|
|
|
filter "system:linux"
|
|
system "linux"
|
|
cppdialect "C++20"
|
|
staticruntime "off"
|
|
runtime "Release"
|
|
systemversion "latest"
|
|
|
|
defines{
|
|
"PLATFORM_LINUX"
|
|
}
|
|
|
|
-- TELL THE LINKER TO USE SYSTEM LIBS
|
|
links {
|
|
"dl", -- Dynamic linking loader (often needed)
|
|
"pthread" -- POSIX threads (often needed)
|
|
}
|
|
|
|
filter "configurations:Debug"
|
|
defines "DEBUG"
|
|
symbols "On"
|
|
|
|
filter "configurations:Release"
|
|
defines "RELEASE"
|
|
optimize "On"
|
|
symbols "off"
|