Skip to content

Commit

Permalink
Split the ios/gen into gen_ios and gen_simulator.
Browse files Browse the repository at this point in the history
  • Loading branch information
domchen committed Nov 13, 2023
1 parent f282781 commit 6576b16
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
25 changes: 13 additions & 12 deletions ios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
1 change: 0 additions & 1 deletion ios/gen → ios/gen_ios
Original file line number Diff line number Diff line change
@@ -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, "../"));
Expand Down
14 changes: 14 additions & 0 deletions ios/gen_simulator
Original file line number Diff line number Diff line change
@@ -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");

0 comments on commit 6576b16

Please sign in to comment.