mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
android: build mainui_cpp through CMake
This commit is contained in:
@@ -62,6 +62,7 @@ def main():
|
||||
# build SDL2 and hlsdk-portable with cmake
|
||||
sdl_bin_path = os.path.join(args.out_dir, "SDL")
|
||||
hlsdk_bin_path = os.path.join(args.out_dir, "hlsdk-portable")
|
||||
mainui_bin_path = os.path.join(args.out_dir, "mainui")
|
||||
|
||||
abi = args.waflock.replace(".lock-waf_android_", "").replace("_build", "")
|
||||
inst_path = os.path.join(args.top_dir, "android", "app", "src", "main", "jniLibs", abi)
|
||||
@@ -71,6 +72,7 @@ def main():
|
||||
|
||||
run_cmake(sdl_bin_path, ["libSDL2.so"], inst_path)
|
||||
run_cmake(hlsdk_bin_path, None, inst_path)
|
||||
run_cmake(mainui_bin_path, None, inst_path)
|
||||
|
||||
process = subprocess.Popen(waf_exec, env=env)
|
||||
process.communicate()
|
||||
|
||||
@@ -29,13 +29,16 @@ def check_repo(name, branch, url, path):
|
||||
|
||||
|
||||
def run_cmake(root, out, toolchain, abi, build_type, ndk_root, min_sdk, *args):
|
||||
cmake_exec = ["cmake", "-H{}".format(root), "-DCMAKE_BUILD_TYPE={}".format(build_type),
|
||||
"-DCMAKE_TOOLCHAIN_FILE={}".format(toolchain), "-DANDROID_ABI={}".format(abi),
|
||||
"-DANDROID_NDK={}".format(ndk_root),
|
||||
"-DANDROID_PLATFORM=android-{}".format(min_sdk),
|
||||
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
|
||||
"-DCMAKE_SYSTEM_NAME=Android", "-DCMAKE_SYSTEM_VERSION={}".format(min_sdk),
|
||||
"-B{}".format(out), "-GNinja"]
|
||||
cmake_exec = ["cmake", "-H{}".format(root),
|
||||
"-DCMAKE_BUILD_TYPE={}".format(build_type),
|
||||
"-DCMAKE_TOOLCHAIN_FILE={}".format(toolchain),
|
||||
"-DANDROID_ABI={}".format(abi),
|
||||
"-DANDROID_NDK={}".format(ndk_root),
|
||||
"-DANDROID_PLATFORM=android-{}".format(min_sdk),
|
||||
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
|
||||
"-DCMAKE_SYSTEM_NAME=Android",
|
||||
"-DCMAKE_SYSTEM_VERSION={}".format(min_sdk),
|
||||
"-B{}".format(out), "-GNinja"]
|
||||
|
||||
cmake_exec.extend(args)
|
||||
cmake_process = subprocess.Popen(cmake_exec)
|
||||
@@ -79,6 +82,13 @@ def main():
|
||||
run_cmake(hlsdk_path, hlsdk_out_path, cmake_toolchain_path, abi, cmake_build_type, args.ndk_root,
|
||||
args.min_sdk_version, "-DANDROID_APK=ON")
|
||||
|
||||
# configure mainui_cpp
|
||||
mainui_path = os.path.join(args.wscript_path, "3rdparty", "mainui")
|
||||
mainui_out_path = os.path.join(args.configuration_dir, "mainui")
|
||||
|
||||
run_cmake(mainui_path, mainui_out_path, cmake_toolchain_path, abi, cmake_build_type, args.ndk_root,
|
||||
args.min_sdk_version, "-DBUILD_AS_PART_OF_ENGINE=ON")
|
||||
|
||||
# waf configure
|
||||
waf_path = os.path.join(args.wscript_path, "waf")
|
||||
out_path = os.path.join(args.configuration_dir, "xash3d-fwgs")
|
||||
|
||||
Reference in New Issue
Block a user