-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpremake5.lua
129 lines (105 loc) · 3.01 KB
/
premake5.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
workspace "Arithmetic Coder"
architecture "x86_64"
configurations {
"Release",
"Debug"
}
targetdir "bin/%{cfg.buildcfg}/%{prj.name}"
objdir "obj/%{cfg.buildcfg}/%{prj.name}"
startproject "AC_CLI"
filter "system:Windows"
systemversion "latest"
filter "Release"
defines { "NDEBUG", "RELEASE" }
optimize "On"
filter "Debug"
defines { "DEBUG" }
symbols "On"
-- <filesystem> support for all projects
filter "toolset:gcc" -- GCC v8.x
links "stdc++fs"
filter "toolset:clang" -- clang
if _OPTIONS["cc"] == "clang" then
premake.warn("Clang is not supporterd yet. Problems with <filesystem> may occur.")
end
--links "c++fs"
--buildoptions {"-stdlib=libc++"}
filter {}
-- AC_Core project cotains logic and algorithms for arithmetic coding.
-- It also manages filesystem for input and output data.
project "AC_Core"
location "AC_Core"
kind "StaticLib"
language "C++"
cppdialect "C++17"
targetname "ac_core"
files {
"%{prj.name}/src/**.hpp",
"%{prj.name}/src/**.cpp"
}
filter "Release"
optimize "Speed"
-- Simple Command-Line Interface for AC_Core.
-- There should be no critical logic here.
project "AC_CLI"
location "AC_CLI"
kind "ConsoleApp"
language "C++"
cppdialect "C++17"
targetname "ac"
files {
"%{prj.name}/src/**.hpp",
"%{prj.name}/src/**.cpp",
"%{prj.name}/vendor/CLI/CLI11.hpp"
}
includedirs {
"AC_Core/src",
"%{prj.name}/vendor"
}
links {
"AC_Core"
}
group "Tests"
-- Tests project for AC_Core. It produces executable with
-- embeded CLI from Catch2. Run this program with no arguments
-- to simply run all the tests.
project "AC_Core_Tests"
location "AC_Core_Tests"
kind "ConsoleApp"
language "C++"
cppdialect "C++17"
targetname "ac_core_tests"
files {
"%{prj.name}/src/**.hpp",
"%{prj.name}/src/**.cpp",
"%{prj.name}/vendor/catch2/catch.hpp"
}
includedirs {
"AC_Core/src",
"%{prj.name}/vendor"
}
links {
"AC_Core"
}
group ""
-- Additional actions for maintaining project files.
newaction {
trigger = "clean",
description = "Clean project from binaries and obj files",
execute = function ()
print("Removing bin/...")
os.rmdir("./bin")
print("Removing obj/...")
os.rmdir("./obj")
print("Done")
end
}
newaction {
trigger = "reset",
description = "Removes all files ignored by git",
execute = function()
print("Removing generated files...")
os.execute("git clean -Xdf")
print("Done")
end
}