diff options
Diffstat (limited to '3rdparty/bx/scripts/bx.lua')
-rw-r--r-- | 3rdparty/bx/scripts/bx.lua | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/3rdparty/bx/scripts/bx.lua b/3rdparty/bx/scripts/bx.lua index bb0d17ade18..1bb5dc43d4b 100644 --- a/3rdparty/bx/scripts/bx.lua +++ b/3rdparty/bx/scripts/bx.lua @@ -1,8 +1,42 @@ -- --- Copyright 2010-2018 Branimir Karadzic. All rights reserved. --- License: https://github.com/bkaradzic/bx#license-bsd-2-clause +-- Copyright 2010-2022 Branimir Karadzic. All rights reserved. +-- License: https://github.com/bkaradzic/bx/blob/master/LICENSE -- +local function userdefines() + local defines = {} + local BX_CONFIG = os.getenv("BX_CONFIG") + if BX_CONFIG then + for def in BX_CONFIG:gmatch "[^%s:]+" do + table.insert(defines, "BX_CONFIG_" .. def) + end + end + + return defines +end + +function using_bx() + includedirs { + path.join(BX_DIR, "include"), + } + + links { + "bx", + } + + configuration { "Debug" } + defines { + "BX_CONFIG_DEBUG=1", + } + + configuration { "Release" } + defines { + "BX_CONFIG_DEBUG=0", + } + + configuration {} +end + project "bx" kind "StaticLib" @@ -18,10 +52,7 @@ project "bx" path.join(BX_DIR, "scripts/**.natvis"), } - configuration { "Debug" } - defines { - "BX_CONFIG_DEBUG=1", - } + defines (userdefines()) configuration { "linux-*" } buildoptions { @@ -33,6 +64,7 @@ project "bx" if _OPTIONS["with-amalgamated"] then excludes { path.join(BX_DIR, "src/allocator.cpp"), + path.join(BX_DIR, "src/bounds.cpp"), path.join(BX_DIR, "src/bx.cpp"), path.join(BX_DIR, "src/commandline.cpp"), path.join(BX_DIR, "src/crtnone.cpp"), @@ -60,4 +92,14 @@ project "bx" } end + configuration { "Debug" } + defines { + "BX_CONFIG_DEBUG=1", + } + + configuration { "Release" } + defines { + "BX_CONFIG_DEBUG=0", + } + configuration {} |