Files
Tower-Defense/xmake.lua
2022-12-11 12:59:57 +01:00

52 lines
1.5 KiB
Lua

add_rules("mode.debug", "mode.release")
add_defines("TD_IMPL_OPENGL_LOADER_GLEW");
add_requires("libsdl >= 2", "zlib", "glew")
target("TowerDefense")
set_kind("binary")
add_includedirs("include")
add_files("src/*.cpp", "src/*/*.cpp", "src/*/*/*.cpp", "src/*/*/*/*.cpp")
add_cxflags("-pthread")
add_links("pthread")
set_languages("c++17")
add_packages("zlib", "libsdl", "glew", "opengl", "glm")
if is_os("windows") then
add_links("ws2_32") -- link network stuff
end
if is_mode("release") then
-- mark symbols visibility as hidden
set_symbols("hidden")
-- strip all symbols
add_ldflags("-s")
set_warnings("all", "error")
set_optimize("smallest")
else -- debug stuff
if is_os("linux") then
add_links("dw")
end
if is_os("windows") then
add_links("dbghelp", "psapi", "kernel32", "msvcr90")
end
add_cxflags("-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused")
end
-- run windows program with wine on linux
if is_host("linux") and is_os("windows") then
on_run(function(target)
os.cd("test")
os.runv("wine", {target:targetfile()})
end)
end