1--
2-- Copyright 2010-2019 Branimir Karadzic. All rights reserved.
3-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
4--
5
6newoption {
7	trigger = "with-amalgamated",
8	description = "Enable amalgamated build.",
9}
10
11newoption {
12	trigger = "with-crtnone",
13	description = "Enable build without CRT.",
14}
15
16solution "bx"
17	configurations {
18		"Debug",
19		"Release",
20	}
21
22	platforms {
23		"x32",
24		"x64",
25		"Native", -- for targets where bitness is not specified
26	}
27
28	language "C++"
29
30BX_DIR = path.getabsolute("..")
31BX_BUILD_DIR = path.join(BX_DIR, ".build")
32BX_THIRD_PARTY_DIR = path.join(BX_DIR, "3rdparty")
33
34dofile "toolchain.lua"
35toolchain(BX_BUILD_DIR, BX_THIRD_PARTY_DIR)
36
37function copyLib()
38end
39
40dofile "bx.lua"
41dofile "bin2c.lua"
42dofile "lemon.lua"
43
44project "bx.test"
45	kind "ConsoleApp"
46
47	debugdir (path.join(BX_DIR, "tests"))
48
49	removeflags {
50		"NoExceptions",
51	}
52
53	includedirs {
54		path.join(BX_DIR, "include"),
55		BX_THIRD_PARTY_DIR,
56	}
57
58	files {
59		path.join(BX_DIR, "tests/*_test.cpp"),
60		path.join(BX_DIR, "tests/*.h"),
61		path.join(BX_DIR, "tests/dbg.*"),
62	}
63
64	links {
65		"bx",
66	}
67
68	configuration { "vs* or mingw*" }
69		links {
70			"psapi",
71		}
72
73	configuration { "android*" }
74		targetextension ".so"
75		linkoptions {
76			"-shared",
77		}
78
79	configuration { "linux-*" }
80		links {
81			"pthread",
82		}
83
84	configuration { "osx" }
85		links {
86			"Cocoa.framework",
87		}
88
89	configuration {}
90
91	strip()
92
93project "bx.bench"
94	kind "ConsoleApp"
95
96	debugdir (path.join(BX_DIR, "tests"))
97
98	includedirs {
99		path.join(BX_DIR, "include"),
100		BX_THIRD_PARTY_DIR,
101	}
102
103	files {
104		path.join(BX_DIR, "tests/*_bench.cpp"),
105		path.join(BX_DIR, "tests/*_bench.h"),
106		path.join(BX_DIR, "tests/dbg.*"),
107	}
108
109	links {
110		"bx",
111	}
112
113	configuration { "vs* or mingw*" }
114		links {
115			"psapi",
116		}
117
118	configuration { "android*" }
119		targetextension ".so"
120		linkoptions {
121			"-shared",
122		}
123
124	configuration { "linux-*" }
125		links {
126			"pthread",
127		}
128
129	configuration { "osx" }
130		links {
131			"Cocoa.framework",
132		}
133
134	configuration {}
135
136	strip()
137