From 6576b16d862b0e4b3117975a51fa4c46e6dd6ed3 Mon Sep 17 00:00:00 2001 From: domrjchen Date: Mon, 13 Nov 2023 19:07:25 +0800 Subject: [PATCH] Split the ios/gen into gen_ios and gen_simulator. --- ios/README.md | 25 +++++++++++++------------ ios/{gen => gen_ios} | 1 - ios/gen_simulator | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 13 deletions(-) rename ios/{gen => gen_ios} (92%) create mode 100755 ios/gen_simulator diff --git a/ios/README.md b/ios/README.md index 94b9fb90..a14e026a 100644 --- a/ios/README.md +++ b/ios/README.md @@ -6,27 +6,28 @@ A minimal project that demonstrates how to integrate the tgfx library into your Before you begin building the demo project, please make sure to carefully follow the instructions provided in the [README.md](../README.md) file located in the root directory. That documentation -will guide -you through the necessary steps to configure your development environment. +will guide you through the necessary steps to configure your development environment. ## Build & Run -Run the following command in the ios/ directory: +Run the following command in the ios/ directory or simply double-click on it: ``` -./gen [-p ios|simulator] [-a arm64|x64] [-Dcmake_variable=value]... +./gen_ios ``` -The `-a` option is used to specify the project architecture that accepts either `arm64` or `x64`. -The `-a x64` option is valid only with `-p simulator`. If no platform is specified, the script -will default to `ios`. Additionally, you can pass cmake options using the `-D` option. For example, -if you want to generate a project with webp encoding support for the arm64 simulator, you can -execute the following command: +This will generate an XCode project for iphoneos devices. If you want to generate a project for the +simulator, use the following command instead: ``` -./gen -p simulator -a arm64 -DTGFX_USE_WEBP_ENCODE=ON +./gen_simulator ``` -And then, launch XCode and open the ios/Hello2D.xcworkspace. Once you've done that, you'll be all -set and ready to go! +Additionally, you can pass cmake options using the `-D` option. For example, if you want to generate +a project with webp encoding support, please run the following command: +``` +./gen_ios -DTGFX_USE_WEBP_ENCODE=ON +``` + +At last, launch XCode and open the ios/Hello2D.xcworkspace. You'll be ready to go! \ No newline at end of file diff --git a/ios/gen b/ios/gen_ios similarity index 92% rename from ios/gen rename to ios/gen_ios index 5198e797..483842fa 100755 --- a/ios/gen +++ b/ios/gen_ios @@ -1,5 +1,4 @@ #!/usr/bin/env node -// run 'gen -h" to print help message const path = require('path'); process.argv.push(path.resolve(__dirname, "../")); diff --git a/ios/gen_simulator b/ios/gen_simulator new file mode 100755 index 00000000..c7f35188 --- /dev/null +++ b/ios/gen_simulator @@ -0,0 +1,14 @@ +#!/usr/bin/env node +const path = require('path'); + +process.argv.push(path.resolve(__dirname, "../")); +let args = process.argv.slice(2); +if (args.indexOf("-p") === -1 && args.indexOf("--platform") === -1) { + process.argv.push("-p"); + process.argv.push("simulator"); +} +if (args.indexOf("-o") === -1 && args.indexOf("--output") === -1) { + process.argv.push("-o"); + process.argv.push(__dirname); +} +require("../third_party/vendor_tools/xcode-gen"); \ No newline at end of file