mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 19:25:35 +08:00
restore custom-cmake option
This commit is contained in:
parent
ab7cf031a6
commit
39efb03cd2
@ -31,6 +31,14 @@ newoption {
|
|||||||
trigger = "clean",
|
trigger = "clean",
|
||||||
description = "Cleanup before any action",
|
description = "Cleanup before any action",
|
||||||
}
|
}
|
||||||
|
-- tools
|
||||||
|
newoption {
|
||||||
|
category = "tools",
|
||||||
|
trigger = "custom-cmake",
|
||||||
|
description = "Use custom cmake",
|
||||||
|
value = 'path/to/cmake.exe',
|
||||||
|
default = nil
|
||||||
|
}
|
||||||
|
|
||||||
-- deps extraction
|
-- deps extraction
|
||||||
newoption {
|
newoption {
|
||||||
@ -144,11 +152,17 @@ local third_party_common_dir = path.join(third_party_dir, 'deps', 'common')
|
|||||||
local extractor = os.realpath(path.join(third_party_deps_dir, '7za', '7za'))
|
local extractor = os.realpath(path.join(third_party_deps_dir, '7za', '7za'))
|
||||||
local mycmake = os.realpath(path.join(third_party_deps_dir, 'cmake', 'bin', 'cmake'))
|
local mycmake = os.realpath(path.join(third_party_deps_dir, 'cmake', 'bin', 'cmake'))
|
||||||
|
|
||||||
if os.host() == 'windows' then
|
if _OPTIONS["custom-cmake"] then
|
||||||
mycmake = mycmake .. '.exe'
|
mycmake = _OPTIONS["custom-cmake"]
|
||||||
end
|
print('using custom cmake: ' .. _OPTIONS["custom-cmake"])
|
||||||
if not os.isfile(mycmake) then
|
else
|
||||||
error('cmake is missing from third-party dir, you can specify custom cmake location, run the script with --help. cmake: ' .. mycmake)
|
if os.host() == 'windows' then
|
||||||
|
if os.host() == 'windows' then
|
||||||
|
mycmake = mycmake .. '.exe'
|
||||||
|
end
|
||||||
|
if not os.isfile(mycmake) then
|
||||||
|
error('cmake is missing from third-party dir, you can specify custom cmake location, run the script with --help. cmake: ' .. mycmake)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not third_party_dir or not os.isdir(third_party_dir) then
|
if not third_party_dir or not os.isdir(third_party_dir) then
|
||||||
@ -341,10 +355,12 @@ if os.host() == "linux" then
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local ok_chmod, err_chmod = os.chmod(mycmake, "777")
|
if not _OPTIONS["custom-cmake"] then
|
||||||
if not ok_chmod then
|
local ok_chmod, err_chmod = os.chmod(mycmake, "777")
|
||||||
error("cannot chmod: " .. err_chmod)
|
if not ok_chmod then
|
||||||
return
|
error("cannot chmod: " .. err_chmod)
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user