forked from sumatrapdfreader/sumatrapdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.unix.lua
105 lines (83 loc) · 2.7 KB
/
premake5.unix.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
--[[
This is for generating unix makefile.
I'm using premake5 alpha12 from http://premake.github.io/download.html#v5
(premake4 won't work, it doesn't support VS 2013+)
--]]
include("premake5.files.lua")
workspace "SumatraPDF"
toolset "gcc"
configurations { "Debug", "Release" }
platforms { "x64" }
startproject "test_unix"
filter "platforms:x64"
architecture "x86_64"
filter {}
warnings "Extra"
location "."
filter {"platforms:x64", "configurations:Release"}
targetdir "out/rel64_unix"
filter {"platforms:x64", "configurations:Debug"}
targetdir "out/dbg64_unix"
filter {}
objdir "%{cfg.targetdir}/obj"
symbols "On"
-- https://github.com/premake/premake-core/wiki/flags
flags {
"MultiProcessorCompile",
"StaticRuntime",
-- "Unicode", TODO: breaks libdjuv?
}
-- expansion-to-defined reports as error commonly used pattern
-- but not present in mac os x clang
-- https://stackoverflow.com/questions/42074035/how-to-deal-with-clangs-3-9-wexpansion-to-defined-warning
-- it's used in https://abseil.io/ headers so should be safe
disablewarnings { "implicit-fallthrough" }
flags { "FatalWarnings" }
exceptionhandling "Off"
rtti "Off"
defines { }
filter "configurations:Debug"
defines { "DEBUG" }
filter "configurations:Release*"
defines { "NDEBUG" }
optimize "On"
filter {}
project "unarrlib"
kind "StaticLib"
language "C"
-- TODO: for bzip2, need BZ_NO_STDIO and BZ_DEBUG=0
-- TODO: for lzma, need _7ZIP_PPMD_SUPPPORT
defines { "HAVE_ZLIB", "HAVE_BZIP2", "BZ_NO_STDIO" }
-- TODO: most of these warnings are due to bzip2 and lzma
filter "toolset:gcc"
disablewarnings { "unused-parameter", "unused-but-set-variable", "int-conversion", "implicit-function-declaration", "type-limits", "sign-compare" }
filter {}
includedirs { "ext/zlib", "ext/bzip2" }
unarr_no_lzma_files()
project "zlib"
kind "StaticLib"
language "C"
filter "toolset:gcc"
disablewarnings { "implicit-function-declaration", "shift-negative-value" }
filter {}
zlib_files()
project "unarr"
kind "ConsoleApp"
language "C"
disablewarnings { "4100" }
files { "ext/unarr/main.c" }
links { "unarrlib", "zlib" }
project "test_unix"
kind "ConsoleApp"
language "C++"
cppdialect "C++latest"
includedirs { "src", "src/utils", "ext/unarr" }
links { "unarrlib", "zlib" }
files {
"src/utils/Archive.cpp",
"src/utils/BaseUtil.cpp",
"src/utils/FileUtil.cpp",
"src/utils/StrUtil.cpp",
"src/utils/UtAssert.cpp",
"tools/test_unix/main.cpp",
}