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") 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("fastest") 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=1 -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.execv("wine", {target:targetfile()}) end) end