summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2019-02-03 14:47:15 +0100
committerNao Pross <naopross@thearcway.org>2019-02-03 15:04:45 +0100
commit59ed0276d1024fc6157044e92549bef264a830ef (patch)
tree9f50079f66b1e9c3d486fd0dee0a773edfbcaba7
parentMerge remote-tracking branch 'raffa-https/master' (diff)
downloadflatland-59ed0276d1024fc6157044e92549bef264a830ef.tar.gz
flatland-59ed0276d1024fc6157044e92549bef264a830ef.zip
Add premake4 conf, to replace configure.py (in the near future)HEADmaster
-rw-r--r--.gitignore3
m---------lib/libwrapsdl20
-rw-r--r--premake4.lua87
3 files changed, 90 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 1f24bab..1d9887b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,9 @@ build
.ninja_log
build.ninja
+# makefiles
+Makefile
+
# ctag files
tags
diff --git a/lib/libwrapsdl2 b/lib/libwrapsdl2
deleted file mode 160000
-Subproject 736ec71fce673d5aa88228b96acfe6c6862a223
diff --git a/premake4.lua b/premake4.lua
new file mode 100644
index 0000000..da82f23
--- /dev/null
+++ b/premake4.lua
@@ -0,0 +1,87 @@
+--[[ project solution / workspace, global configuration ]]--
+solution "flatland"
+ configurations { "debug", "release" }
+
+ -- build configurations
+ flags { "ExtraWarnings" }
+ buildoptions { "-std=c++17" }
+
+ --- for linux specifically
+ configuration { "linux", "gmake" }
+ buildoptions {
+ "-pedantic", "-Wall", "-Wextra", "-Wcast-qual", "-Wcast-align",
+ "-Wpointer-arith", "-Winit-self", "-Wshadow", "-Wswitch-enum",
+ "-Wredundant-decls", "-Wfloat-equal", "-Wundef", "-Wvla",
+ "-Wconversion", "-Wstrict-aliasing"
+ }
+
+
+--[[ custom lua code ]]--
+local test = {
+ add_specific = function(name, src, tested_src)
+ local sources = {}
+ table.insert(sources, src)
+
+ io.write("Added specific test " .. src .. " to test { ")
+ for k, v in pairs(tested_src) do
+ io.write(v .. " " )
+ table.insert(sources, v)
+ end
+ print("}")
+
+ project("libflatland-test-" .. name)
+ language("C++")
+ kind("ConsoleApp")
+ location("build/")
+
+ includedirs({ "engine/include", "lib/include" })
+ files(sources)
+
+ configuration("debug")
+ targetdir("build/debug")
+
+ defines({ "DEBUG" })
+ flags({ "Symbols" })
+ end
+}
+
+local dependency = {
+ build = function(path, commands)
+ print("Building dependency under " .. path)
+ for k, cmd in pairs(commands) do
+ print(" Running " .. cmd)
+ os.execute("cd " .. path .. "; " .. cmd)
+ end
+ end
+}
+
+--[[ dependencies ]]--
+dependency.build("lib/libwsdl2", { "./configure.py", "ninja" })
+dependency.build("lib/libmm", { "ninja" })
+
+--[[ main project ]]--
+project "libflatland"
+ -- project
+ language "C++"
+ kind "SharedLib"
+ location "build/"
+
+ -- source code
+ files { "engine/**.cpp" }
+ includedirs { "lib/include", "engine/include" }
+
+ configuration "debug"
+ targetdir "build/debug"
+
+ defines { "DEBUG" }
+ flags { "Symbols" }
+
+ configuration "release"
+ targetdir "build/release"
+
+ flags { "Optimize" }
+
+-- add tests
+test.add_specific("task", "test/task_test.cpp", {
+ "engine/task.cpp"
+})