summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/make.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-18 19:23:31 +0800
committerGitHub <[email protected]>2021-12-18 19:23:31 +0800
commit7be1bc272914b757a4a7fe1792f7590de4a91cdf (patch)
treec16cd8fb4ac3dc3b9c2e2f43c8acd470fc7e373f /xmake/modules/package/tools/make.lua
parenta062353449af599c22adf55906ad311103660b50 (diff)
Update make.lua
Diffstat (limited to 'xmake/modules/package/tools/make.lua')
-rw-r--r--xmake/modules/package/tools/make.lua24
1 files changed, 16 insertions, 8 deletions
diff --git a/xmake/modules/package/tools/make.lua b/xmake/modules/package/tools/make.lua
index cbc58c9e2..27e73b412 100644
--- a/xmake/modules/package/tools/make.lua
+++ b/xmake/modules/package/tools/make.lua
@@ -23,6 +23,14 @@ import("core.base.option")
import("core.project.config")
import("lib.detect.find_tool")
+-- translate bin path
+function _translate_bin_path(bin_path)
+ if is_host("windows") and bin_path then
+ return bin_path:gsub("\\", "/") .. ".exe"
+ end
+ return bin_path
+end
+
-- get the build environments
function buildenvs(package)
local envs = {}
@@ -44,14 +52,14 @@ function buildenvs(package)
else
local cflags = table.join(table.wrap(package:build_getenv("cxflags")), package:build_getenv("cflags"))
local cxxflags = table.join(table.wrap(package:build_getenv("cxflags")), package:build_getenv("cxxflags"))
- envs.CC = package:build_getenv("cc")
- envs.CXX = package:build_getenv("cxx")
- envs.AS = package:build_getenv("as")
- envs.AR = package:build_getenv("ar")
- envs.LD = package:build_getenv("ld")
- envs.LDSHARED = package:build_getenv("sh")
- envs.CPP = package:build_getenv("cpp")
- envs.RANLIB = package:build_getenv("ranlib")
+ envs.CC = _translate_bin_path(package:build_getenv("cc"))
+ envs.CXX = _translate_bin_path(package:build_getenv("cxx"))
+ envs.AS = _translate_bin_path(package:build_getenv("as"))
+ envs.AR = _translate_bin_path(package:build_getenv("ar"))
+ envs.LD = _translate_bin_path(package:build_getenv("ld"))
+ envs.LDSHARED = _translate_bin_path(package:build_getenv("sh"))
+ envs.CPP = _translate_bin_path(package:build_getenv("cpp"))
+ envs.RANLIB = _translate_bin_path(package:build_getenv("ranlib"))
envs.CFLAGS = table.concat(cflags, ' ')
envs.CXXFLAGS = table.concat(cxxflags, ' ')
envs.ASFLAGS = table.concat(table.wrap(package:build_getenv("asflags")), ' ')