|
@@ -3,6 +3,38 @@
|
|
|
-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
|
|
-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
|
|
|
--
|
|
--
|
|
|
|
|
|
|
|
|
|
+function filesexist(_srcPath, _dstPath, _files)
|
|
|
|
|
+ for _, file in ipairs(_files) do
|
|
|
|
|
+ file = path.getrelative(_srcPath, file)
|
|
|
|
|
+ local filePath = path.join(_dstPath, file)
|
|
|
|
|
+ if not os.isfile(filePath) then return false end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ return true
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
|
|
+function overridefiles(_srcPath, _dstPath, _files)
|
|
|
|
|
+
|
|
|
|
|
+ local remove = {}
|
|
|
|
|
+ local add = {}
|
|
|
|
|
+ for _, file in ipairs(_files) do
|
|
|
|
|
+ file = path.getrelative(_srcPath, file)
|
|
|
|
|
+ local filePath = path.join(_dstPath, file)
|
|
|
|
|
+ if not os.isfile(filePath) then return end
|
|
|
|
|
+
|
|
|
|
|
+ table.insert(remove, path.join(_srcPath, file))
|
|
|
|
|
+ table.insert(add, filePath)
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ removefiles {
|
|
|
|
|
+ remove,
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ files {
|
|
|
|
|
+ add,
|
|
|
|
|
+ }
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
project "bimg"
|
|
project "bimg"
|
|
|
kind "StaticLib"
|
|
kind "StaticLib"
|
|
|
|
|
|
|
@@ -16,9 +48,17 @@ project "bimg"
|
|
|
path.join(BIMG_DIR, "src/image.*"),
|
|
path.join(BIMG_DIR, "src/image.*"),
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ overridefiles(BIMG_DIR, path.join(BIMG_DIR, "../bimg-ext"), {
|
|
|
|
|
+ path.join(BIMG_DIR, "src/image_gnf.cpp"),
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
configuration { "linux-*" }
|
|
configuration { "linux-*" }
|
|
|
buildoptions {
|
|
buildoptions {
|
|
|
"-fPIC",
|
|
"-fPIC",
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
configuration {}
|
|
configuration {}
|
|
|
|
|
+
|
|
|
|
|
+ if filesexist(BIMG_DIR, path.join(BIMG_DIR, "../bimg-ext"), { path.join(BIMG_DIR, "scripts/bimg.lua"), }) then
|
|
|
|
|
+ dofile(path.join(BIMG_DIR, "../bimg-ext/scripts/bimg.lua") )
|
|
|
|
|
+ end
|