2026-01-26 20:26:28 +01:00
|
|
|
require("premake", ">=5.0.0-beta8")
|
2025-01-12 23:47:59 +01:00
|
|
|
|
2021-03-03 11:55:37 -08:00
|
|
|
include "tools/scripts/folders.lua"
|
|
|
|
|
include "tools/scripts/including.lua"
|
|
|
|
|
include "tools/scripts/linking.lua"
|
|
|
|
|
include "tools/scripts/options.lua"
|
|
|
|
|
include "tools/scripts/platform.lua"
|
2024-01-23 21:53:01 +01:00
|
|
|
include "tools/scripts/version.lua"
|
2024-09-14 12:21:43 +02:00
|
|
|
include "tools/scripts/source_templating.lua"
|
2021-03-03 06:21:25 -08:00
|
|
|
|
2019-10-22 00:13:38 +02:00
|
|
|
-- ==================
|
|
|
|
|
-- Workspace
|
|
|
|
|
-- ==================
|
|
|
|
|
workspace "OpenAssetTools"
|
|
|
|
|
location "build"
|
|
|
|
|
objdir "%{wks.location}/obj"
|
|
|
|
|
symbols "On"
|
|
|
|
|
systemversion "latest"
|
2025-04-06 17:42:49 +02:00
|
|
|
cppdialect "C++23"
|
2024-03-03 10:47:31 +01:00
|
|
|
largeaddressaware "on"
|
2026-01-26 20:26:28 +01:00
|
|
|
multiprocessorcompile "on"
|
2019-10-22 00:13:38 +02:00
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
|
"Debug",
|
|
|
|
|
"Release"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
platforms {
|
|
|
|
|
"x86",
|
|
|
|
|
"x64"
|
|
|
|
|
}
|
2019-10-24 14:29:59 +02:00
|
|
|
defaultplatform "x86"
|
2019-10-22 00:13:38 +02:00
|
|
|
|
2026-01-27 18:29:01 +01:00
|
|
|
filter "toolset:msc"
|
|
|
|
|
disablewarnings {
|
|
|
|
|
"26812" -- Prefer enum class over unscoped
|
|
|
|
|
}
|
|
|
|
|
filter {}
|
2022-03-25 14:13:13 +01:00
|
|
|
|
2019-10-22 00:13:38 +02:00
|
|
|
filter "platforms:x86"
|
|
|
|
|
architecture "x86"
|
|
|
|
|
defines "ARCH_x86"
|
|
|
|
|
filter {}
|
|
|
|
|
|
|
|
|
|
filter "platforms:x64"
|
|
|
|
|
architecture "x86_64"
|
|
|
|
|
defines "ARCH_x64"
|
|
|
|
|
filter {}
|
|
|
|
|
|
|
|
|
|
filter "configurations:Debug"
|
|
|
|
|
defines "_DEBUG"
|
|
|
|
|
optimize "Debug"
|
2023-11-04 11:58:27 +01:00
|
|
|
symbols "On"
|
2019-10-22 00:13:38 +02:00
|
|
|
filter {}
|
|
|
|
|
|
2025-04-06 18:02:13 +01:00
|
|
|
filter {"system:windows", "configurations:Debug" }
|
|
|
|
|
buildoptions { "/bigobj" }
|
|
|
|
|
filter {}
|
|
|
|
|
|
2019-10-22 00:13:38 +02:00
|
|
|
filter "configurations:Release"
|
|
|
|
|
defines "NDEBUG"
|
|
|
|
|
optimize "Full"
|
2023-06-18 15:19:40 +02:00
|
|
|
symbols "Off"
|
2025-01-12 23:45:11 +00:00
|
|
|
fatalwarnings { "All" }
|
2019-10-22 00:13:38 +02:00
|
|
|
filter {}
|
|
|
|
|
|
2021-03-03 14:04:35 +01:00
|
|
|
defines {
|
|
|
|
|
"__STDC_LIB_EXT1__",
|
2021-03-19 16:40:39 +01:00
|
|
|
"__STDC_WANT_LIB_EXT1__=1",
|
|
|
|
|
"_CRT_SECURE_NO_WARNINGS"
|
2021-03-03 14:04:35 +01:00
|
|
|
}
|
2024-01-23 21:53:01 +01:00
|
|
|
|
|
|
|
|
-- Write the current version to a header
|
|
|
|
|
-- This is better than adding it as macro here since changing a global macro would cause a full rebuild
|
|
|
|
|
WriteVersionHeader()
|
|
|
|
|
includedirs {
|
|
|
|
|
GetVersionHeaderFolder()
|
|
|
|
|
}
|
2022-03-20 16:59:37 +01:00
|
|
|
|
|
|
|
|
filter "options:debug-structureddatadef"
|
|
|
|
|
defines { "STRUCTUREDDATADEF_DEBUG" }
|
|
|
|
|
filter {}
|
2022-03-24 23:26:07 +01:00
|
|
|
filter "options:debug-techset"
|
|
|
|
|
defines { "TECHSET_DEBUG" }
|
|
|
|
|
filter {}
|
2025-06-28 16:06:11 +01:00
|
|
|
filter "options:experimental-material-compilation"
|
|
|
|
|
defines { "EXPERIMENTAL_MATERIAL_COMPILATION" }
|
|
|
|
|
filter {}
|
2021-03-03 14:04:35 +01:00
|
|
|
|
2019-10-22 00:13:38 +02:00
|
|
|
-- ========================
|
|
|
|
|
-- ThirdParty
|
|
|
|
|
-- ========================
|
2021-02-10 18:03:50 +01:00
|
|
|
include "thirdparty/catch2.lua"
|
2024-05-12 16:35:46 +02:00
|
|
|
include "thirdparty/eigen.lua"
|
2019-10-22 00:13:38 +02:00
|
|
|
include "thirdparty/libtomcrypt.lua"
|
|
|
|
|
include "thirdparty/libtommath.lua"
|
2025-10-01 23:35:37 +01:00
|
|
|
include "thirdparty/lz4.lua"
|
2025-08-28 21:14:12 +02:00
|
|
|
include "thirdparty/lzx.lua"
|
2022-04-18 11:23:05 +02:00
|
|
|
include "thirdparty/json.lua"
|
2019-12-29 16:38:14 +01:00
|
|
|
include "thirdparty/minilzo.lua"
|
|
|
|
|
include "thirdparty/minizip.lua"
|
2019-10-22 00:13:38 +02:00
|
|
|
include "thirdparty/salsa20.lua"
|
2025-10-01 23:35:37 +01:00
|
|
|
include "thirdparty/webview.lua"
|
2019-10-22 00:13:38 +02:00
|
|
|
include "thirdparty/zlib.lua"
|
|
|
|
|
|
2019-10-22 02:40:06 +02:00
|
|
|
-- ThirdParty group: All projects that are external dependencies
|
|
|
|
|
group "ThirdParty"
|
2021-02-10 18:03:50 +01:00
|
|
|
catch2:project()
|
2024-05-12 16:35:46 +02:00
|
|
|
eigen:project()
|
2019-10-22 02:40:06 +02:00
|
|
|
libtomcrypt:project()
|
2025-10-01 23:35:37 +01:00
|
|
|
libtommath:project()
|
|
|
|
|
lz4:project()
|
2025-08-28 21:14:12 +02:00
|
|
|
lzx:project()
|
2022-04-18 11:23:05 +02:00
|
|
|
json:project()
|
2019-12-29 16:38:14 +01:00
|
|
|
minilzo:project()
|
|
|
|
|
minizip:project()
|
2019-10-22 02:40:06 +02:00
|
|
|
salsa20:project()
|
|
|
|
|
zlib:project()
|
2025-10-07 21:50:27 +01:00
|
|
|
|
|
|
|
|
if _OPTIONS["modman"] then
|
|
|
|
|
webview:project()
|
|
|
|
|
end
|
2019-10-22 02:40:06 +02:00
|
|
|
group ""
|
|
|
|
|
|
|
|
|
|
-- ========================
|
|
|
|
|
-- Projects
|
|
|
|
|
-- ========================
|
2021-03-03 12:56:15 -08:00
|
|
|
include "src/Common.lua"
|
2025-04-25 21:26:44 +01:00
|
|
|
include "src/Cryptography.lua"
|
2024-09-23 19:29:58 +02:00
|
|
|
include "src/ImageConverter.lua"
|
2025-12-23 12:49:22 +01:00
|
|
|
include "src/LinkerCli.lua"
|
|
|
|
|
include "src/Linking.lua"
|
2025-10-01 23:35:37 +01:00
|
|
|
include "src/ModMan.lua"
|
2021-03-08 20:06:34 +01:00
|
|
|
include "src/Parser.lua"
|
2022-09-05 23:25:11 +02:00
|
|
|
include "src/RawTemplater.lua"
|
2025-12-23 12:49:22 +01:00
|
|
|
include "src/UnlinkerCli.lua"
|
|
|
|
|
include "src/Unlinking.lua"
|
2019-10-22 02:40:06 +02:00
|
|
|
include "src/Utils.lua"
|
2019-10-25 02:13:37 +02:00
|
|
|
include "src/ZoneCode.lua"
|
2021-02-10 18:03:50 +01:00
|
|
|
include "src/ZoneCodeGeneratorLib.lua"
|
2021-03-01 14:39:29 +01:00
|
|
|
include "src/ZoneCodeGenerator.lua"
|
2019-10-22 02:40:06 +02:00
|
|
|
include "src/ZoneCommon.lua"
|
|
|
|
|
include "src/ZoneLoading.lua"
|
|
|
|
|
include "src/ZoneWriting.lua"
|
2019-12-25 14:07:24 +01:00
|
|
|
include "src/ZoneCommon.lua"
|
2019-12-29 16:40:03 +01:00
|
|
|
include "src/ObjCommon.lua"
|
2024-10-20 14:12:16 +02:00
|
|
|
include "src/ObjCompiling.lua"
|
2024-09-27 21:16:29 +02:00
|
|
|
include "src/ObjImage.lua"
|
2019-12-25 14:07:24 +01:00
|
|
|
include "src/ObjLoading.lua"
|
|
|
|
|
include "src/ObjWriting.lua"
|
2022-08-13 12:24:07 +02:00
|
|
|
include "tools/scripts/raw.lua"
|
2019-10-22 02:40:06 +02:00
|
|
|
|
|
|
|
|
-- Components group: All projects assist or are part of a tool
|
|
|
|
|
group "Components"
|
2021-03-03 12:56:15 -08:00
|
|
|
Common:project()
|
2025-04-25 21:26:44 +01:00
|
|
|
Cryptography:project()
|
2021-03-08 20:06:34 +01:00
|
|
|
Parser:project()
|
2019-10-22 02:40:06 +02:00
|
|
|
Utils:project()
|
2019-10-25 02:13:37 +02:00
|
|
|
ZoneCode:project()
|
2021-02-10 18:03:50 +01:00
|
|
|
ZoneCodeGeneratorLib:project()
|
2019-10-22 02:40:06 +02:00
|
|
|
ZoneCommon:project()
|
|
|
|
|
ZoneLoading:project()
|
|
|
|
|
ZoneWriting:project()
|
2019-12-29 16:40:03 +01:00
|
|
|
ObjCommon:project()
|
2024-10-20 14:12:16 +02:00
|
|
|
ObjCompiling:project()
|
2024-09-27 21:16:29 +02:00
|
|
|
ObjImage:project()
|
2019-12-25 14:07:24 +01:00
|
|
|
ObjLoading:project()
|
|
|
|
|
ObjWriting:project()
|
2025-12-23 12:49:22 +01:00
|
|
|
Linking:project()
|
|
|
|
|
Unlinking:project()
|
2019-10-22 02:40:06 +02:00
|
|
|
group ""
|
|
|
|
|
|
2022-09-05 23:25:11 +02:00
|
|
|
-- Tools group: All projects that compile into the final tools
|
|
|
|
|
group "BuildTools"
|
|
|
|
|
RawTemplater:project()
|
|
|
|
|
ZoneCodeGenerator:project()
|
|
|
|
|
group ""
|
|
|
|
|
|
2019-10-22 02:40:06 +02:00
|
|
|
-- Tools group: All projects that compile into the final tools
|
|
|
|
|
group "Tools"
|
2025-12-23 12:49:22 +01:00
|
|
|
LinkerCli:project()
|
|
|
|
|
UnlinkerCli:project()
|
2024-09-23 19:29:58 +02:00
|
|
|
ImageConverter:project()
|
2025-10-07 21:50:27 +01:00
|
|
|
|
|
|
|
|
if _OPTIONS["modman"] then
|
|
|
|
|
ModMan:project()
|
|
|
|
|
end
|
2019-10-22 02:40:06 +02:00
|
|
|
group ""
|
2019-10-22 00:13:38 +02:00
|
|
|
|
2022-08-13 12:24:07 +02:00
|
|
|
group "Raw"
|
|
|
|
|
Raw:project()
|
|
|
|
|
group ""
|
|
|
|
|
|
2019-10-22 02:40:06 +02:00
|
|
|
-- ========================
|
|
|
|
|
-- Tests
|
|
|
|
|
-- ========================
|
2025-01-05 00:13:46 +00:00
|
|
|
include "test/Catch2Common.lua"
|
2026-02-22 23:17:07 +00:00
|
|
|
include "test/CommonTests.lua"
|
2025-01-01 18:13:23 +01:00
|
|
|
include "test/ObjCommonTestUtils.lua"
|
2020-09-04 12:51:13 +02:00
|
|
|
include "test/ObjCommonTests.lua"
|
2025-01-03 17:51:56 +01:00
|
|
|
include "test/ObjCompilingTests.lua"
|
2021-11-14 12:46:13 +01:00
|
|
|
include "test/ObjLoadingTests.lua"
|
2025-06-29 12:41:54 +01:00
|
|
|
include "test/ObjWritingTests.lua"
|
2021-11-14 12:46:13 +01:00
|
|
|
include "test/ParserTestUtils.lua"
|
2021-11-25 01:20:51 +01:00
|
|
|
include "test/ParserTests.lua"
|
2025-12-19 16:04:54 +01:00
|
|
|
include "test/SystemTests.lua"
|
2021-02-10 18:03:50 +01:00
|
|
|
include "test/ZoneCodeGeneratorLibTests.lua"
|
2019-10-22 02:40:06 +02:00
|
|
|
include "test/ZoneCommonTests.lua"
|
2019-10-22 00:13:38 +02:00
|
|
|
|
2019-10-22 02:40:06 +02:00
|
|
|
-- Tests group: Unit test and other tests projects
|
|
|
|
|
group "Tests"
|
2025-01-05 00:13:46 +00:00
|
|
|
Catch2Common:project()
|
2026-02-22 23:17:07 +00:00
|
|
|
CommonTests:project()
|
2025-01-01 18:13:23 +01:00
|
|
|
ObjCommonTestUtils:project()
|
2020-09-04 12:51:13 +02:00
|
|
|
ObjCommonTests:project()
|
2025-01-03 17:51:56 +01:00
|
|
|
ObjCompilingTests:project()
|
2021-11-14 12:46:13 +01:00
|
|
|
ObjLoadingTests:project()
|
2025-06-29 12:41:54 +01:00
|
|
|
ObjWritingTests:project()
|
2021-11-14 12:46:13 +01:00
|
|
|
ParserTestUtils:project()
|
2021-11-25 01:20:51 +01:00
|
|
|
ParserTests:project()
|
2025-12-19 16:04:54 +01:00
|
|
|
SystemTests:project()
|
2021-02-10 18:03:50 +01:00
|
|
|
ZoneCodeGeneratorLibTests:project()
|
2019-10-22 02:40:06 +02:00
|
|
|
ZoneCommonTests:project()
|
2024-03-03 10:47:31 +01:00
|
|
|
group ""
|