|
1 | 1 | # GLFM build tests
|
2 | 2 |
|
3 |
| -## Automated tests |
| 3 | +The scripts in this directory test building GLFM and the GLFM examples. The analyzer `clang-tidy` is used if it is |
| 4 | +available. |
4 | 5 |
|
5 |
| -The [build.yml](../.github/workflows/build.yml) GitHub Action builds GLFM automatically for all target platforms and arc |
6 |
| -hitectures. Builds fail on compilation warnings or analyzer warnings. |
| 6 | +## Requirements |
7 | 7 |
|
8 |
| -The [build_examples.yml](../.github/workflows/build_examples.yml) GitHub Action builds GLFM examples automatically. |
9 |
| -Builds fail if deprecated functions are used. |
| 8 | +* CMake |
| 9 | +* Emscripten SDK |
| 10 | +* Android SDK/NDK |
| 11 | +* Xcode and xcpretty (macOS only) |
| 12 | +* clang-tidy (optional) |
| 13 | + |
| 14 | +### Linux host |
10 | 15 |
|
11 |
| -## Manual tests |
| 16 | +* Install CMake and clang-tidy with: `sudo apt install cmake clang-tidy`. |
12 | 17 |
|
13 |
| -The scripts in this directory are similar to the GitHub Actions. The scripts work on Linux, macOS, and Windows (tested |
14 |
| -with git-bash/MINGW64). CMake is required. |
| 18 | +### macOS host |
15 | 19 |
|
16 |
| -When running `build_all.sh`, GLFM is conditionally built for each target platform based on the tools installed: |
| 20 | +* Install Xcode from the App Store or from <https://developer.apple.com/download/applications/>. |
| 21 | +* Install CMake and xcpretty: `brew install cmake xcpretty`. |
| 22 | +* Optionally, install LLVM for clang-tidy: `brew install llvm`. |
| 23 | +* Launch Xcode once to make sure the iOS platform is installed. |
17 | 24 |
|
18 |
| -* Apple platforms: Xcode is installed (macOS only). |
19 |
| -* Emscripten: emsdk is installed (`emcmake` is in the path). |
20 |
| -* Android: Android NDK 17 or newer is installed (`ANDROID_NDK_HOME` environment variable is set). |
| 25 | +### Windows host |
21 | 26 |
|
22 |
| -On macOS, `ANDROID_NDK_HOME` is something like "~/Library/Android/sdk/ndk/23.2.8568313". |
| 27 | +* Install Git and CMake: `winget install Git.Git Kitware.CMake`. |
| 28 | +* For Emscripten, install Python and Ninja: `winget install python3 Ninja-build.Ninja`. |
| 29 | +* For Android, install OpenJDK: `winget install openjdk`. |
| 30 | +* Optionally, install LLVM for clang-tidy: `winget install LLVM.LLVM`. |
23 | 31 |
|
24 |
| -## Analyzing with clang-tidy |
| 32 | +### Android |
25 | 33 |
|
26 |
| -The build scripts run `clang-tidy` if it is available. |
| 34 | +* Install either Android Studio or the Android command line tools from <https://developer.android.com/studio>. |
| 35 | +* Install the NDK, either in Android Studio's SDK manager, or using command line with something like: |
| 36 | + ``` |
| 37 | + sdkmanager --list | grep ndk |
| 38 | + sdkmanager --install "ndk;28.0.13004108" |
| 39 | + ``` |
| 40 | +* Set the `ANDROID_NDK_HOME` environment variable to the location of the NDK, which looks something like: |
| 41 | + `~/Library/Android/sdk/ndk/28.0.13004108`. |
27 | 42 |
|
28 |
| -The [clang-tidy-analyze.yml](clang-tidy-analyze.yml) file includes the parent [.clang-tidy](../.clang-tidy) checks and |
29 |
| -adds analyzer checks. Those extra analyzer checks take a bit longer to run. |
| 43 | +### Emscripten |
30 | 44 |
|
31 |
| -The current list of checks in [.clang-tidy](../.clang-tidy) will likely change in the future. |
| 45 | +Install Emscripten SDK from <https://emscripten.org/docs/getting_started/downloads.html>. Alternatively, on macOS, use |
| 46 | +`brew install emscripten`. |
32 | 47 |
|
33 |
| -For Apple platforms ([build_apple.sh](build_apple.sh)), the process of extracting info from `xcodebuild` and sending it |
34 |
| -to `clang-tidy` is a bit fragile and will likely break in the future. As of now, it works with Xcode 14.3 and clang-tidy |
35 |
| -16. |
| 48 | +The tests require that `emcmake` is in the path. |
36 | 49 |
|
37 |
| -### Installing clang-tidy |
| 50 | +## Running |
38 | 51 |
|
39 |
| -For Android targets, the Android NDK has a built in `clang-tidy`. |
| 52 | +Use `./build_all.sh` to run all tests. |
40 | 53 |
|
41 |
| -For Emscripten targets on Ubuntu, install clang-tidy: |
| 54 | +On Windows, use `"C:\Program Files\Git\bin\bash.exe" build_all.sh`. |
42 | 55 |
|
43 |
| -``` |
44 |
| -sudo apt install clang-tidy |
45 |
| -``` |
| 56 | +If a build fails, try `./build_all.sh -v`. |
46 | 57 |
|
47 |
| -For Apple targets, both `xcpretty` and `clang-tidy` are required: |
| 58 | +## Automated tests |
| 59 | + |
| 60 | +The [build.yml](../.github/workflows/build.yml) GitHub Action builds GLFM automatically for all target platforms and |
| 61 | +architectures. Builds fail on compilation warnings or analyzer warnings. |
48 | 62 |
|
49 |
| -``` |
50 |
| -brew install xcpretty llvm |
51 |
| -``` |
| 63 | +The [build_examples.yml](../.github/workflows/build_examples.yml) GitHub Action builds GLFM examples automatically. |
| 64 | +Builds fail if deprecated functions are used. |
52 | 65 |
|
0 commit comments