-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
122 lines (107 loc) · 4.48 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
-- Shared build scripts from repo_build package
repo_build = require("omni/repo/build")
repo_build.root = os.getcwd()
-- module to simplify premake setup further
usdex = true
usdex_build = require("tools/premake/usdex_build")
workspace "usd-exchange-sdk"
usdex_build.setup_workspace({security_hardening=true})
project "devtools"
kind "Utility"
repo_build.prebuild_link({
{ "include", target_build_dir.."/include" },
{ "tools/repoman", target_build_dir.."/dev/tools/repoman" },
{ "tools/vscode", target_build_dir.."/dev/tools/vscode" },
})
-- serialize hardcoded usdex_options
io.writefile(
"_build/generated/usdex_options.lua",
"USD_FLAVOR = \""..USD_FLAVOR.."\"\n"..
"USD_VERSION = \""..USD_VERSION.."\"\n"..
"PYTHON_VERSION = \""..PYTHON_VERSION.."\"\n"
)
-- copy usdex_build and serialized options
repo_build.prebuild_copy({
{ "tools/premake/usdex_build.lua", target_build_dir.."/dev/tools/premake" },
{ "_build/generated/usdex_options.lua", target_build_dir.."/dev/tools/premake" },
})
-- generate a public packman config
io.writefile(
"_build/generated/config.packman.xml",
"<config remotes=\"cloudfront\">\n"..
" <remote2 name=\"cloudfront\">\n"..
" <transport actions=\"download\" protocol=\"https\" packageLocation=\"d4i3qtqj3r0z5.cloudfront.net/${name}@${version}\" />\n"..
" </remote2>\n"..
"</config>\n"
)
-- copy packman and generated public config
repo_build.prebuild_copy({
{ "tools/packman", target_build_dir.."/dev/tools/packman" },
{ "_build/generated/config.packman.xml", target_build_dir.."/dev/tools/packman" },
})
group "core"
namespace = "usdex_core"
project "core_library"
usdex_build.use_omni_transcoding()
usdex_build.use_usd({ "ar", "arch", "gf", "pcp", "plug", "sdf", "tf", "usd", "usdGeom", "usdLux", "usdShade", "usdUtils", "vt" })
usdex_build.shared_library{
library_name = namespace,
headers = { "include/usdex/core/*.h", "include/usdex/core/*.inl" },
sources = { "source/core/library/*.cpp", "source/core/library/*.h" },
}
if usdex_build.with_python() then
project "core_python"
dependson { "core_library" }
usdex_build.use_usd({"gf", "sdf", "tf", "usd", "usdGeom", "usdLux", "usdShade", "vt"})
usdex_build.use_usdex_core()
usdex_build.python_module{
bindings_module_name = namespace,
bindings_sources = "source/core/python/bindings/*.cpp",
python_sources = "source/core/python/*.py",
}
end
project "core_test_executable"
dependson { "core_library" }
usdex_build.use_cxxopts()
usdex_build.use_doctest()
usdex_build.use_usd({"arch", "gf", "sdf", "tf", "usd", "usdGeom", "usdUtils", "vt"})
usdex_build.use_usdex_core()
filter { "configurations:release" }
links { "tbb" } -- required by use of TfErrorMarks
filter { "configurations:debug" }
links { "tbb_debug" } -- required by use of TfErrorMarks
filter {}
usdex_build.executable{
name = "test_"..namespace,
headers = { "source/core/tests/doctest/*.h" },
sources = { "source/core/tests/doctest/*.cpp" },
}
group "rtx"
namespace = "usdex_rtx"
project "rtx_library"
dependson { "core_library" }
usdex_build.use_usd({ "arch", "gf", "sdf", "tf", "usd", "usdShade", "usdUtils", "vt" })
usdex_build.use_usdex_core()
usdex_build.shared_library{
library_name = namespace,
headers = { "include/usdex/rtx/*.h" },
sources = { "source/rtx/library/*.cpp", "source/rtx/library/*.h" },
}
if usdex_build.with_python() then
project "rtx_python"
dependson { "rtx_library" }
usdex_build.use_usd({"gf", "sdf", "tf", "usd", "usdShade", "vt"})
usdex_build.use_usdex_rtx()
usdex_build.python_module{
bindings_module_name = namespace,
bindings_sources = "source/rtx/python/bindings/*.cpp",
python_sources = "source/rtx/python/*.py",
}
end
group "test"
namespace = "usdex_test"
project "devtools"
kind "Utility"
repo_build.prebuild_link({
{ "source/test/python", target_build_dir.."/python/usdex/test" },
})