From 3f6bdb5b0116b8d9f6635a7d3ee36dc6b7fb373c Mon Sep 17 00:00:00 2001 From: badlogic Date: Sat, 26 Mar 2022 01:46:17 +0100 Subject: [PATCH] [cocos2dx] Update instructions for Windows example build. --- .gitignore | 1 + spine-cocos2dx/README.md | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 837cadce3..81d8a4436 100644 --- a/.gitignore +++ b/.gitignore @@ -163,3 +163,4 @@ spine-cocos2dx/example-v4/build-ios spine-cocos2dx/example-v4/build-macos spine-cocos2dx/example/build-ios spine-cocos2dx/example/proj.android/app/.cxx +spine-cocos2dx/example/build-win diff --git a/spine-cocos2dx/README.md b/spine-cocos2dx/README.md index 6bdd34670..7c3a0b643 100644 --- a/spine-cocos2dx/README.md +++ b/spine-cocos2dx/README.md @@ -43,11 +43,11 @@ For reference, have a look at our spine-cocos2dx example project in this reposit ## Example The spine-cocos2dx example works on Windows, Linux, macOS, iOS, Linux, and Android, for both cocos2d-x v3 and v4. -Please [install the reprequisit software](https://docs.cocos2d-x.org/cocos2d-x/v4/en/installation/prerequisites.html) as per the Cocos2d-x documentation. Ensure that the following programs are executable from the command line: +Please [install the reprequisit software](https://docs.cocos2d-x.org/cocos2d-x/v4/en/installation/prerequisites.html) as per the Cocos2d-x documentation. Ensure that the following programs are in your `PATH` environment variable and thus executable from the command line: -* Git -* CMake -* Python +* `git` +* `cmake` +* `python` Before you can compile and run the example project for a specific target platform, you need to clone the [Cocos2d-x repository](https://github.com/cocos2d/cocos2d-x) to `spine-runtimes/spine-cocos2dx/example/cocos2d` and download the dependencies: @@ -79,7 +79,7 @@ Execute the following on the command line: ``` cd spine-runtimes/spine-cocos2dx/example -cmake . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -Bbuild-ios +mkdir build-ios && cmake . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -Bbuild-ios open build-ios/spine-cocos2dx-example.xcodeproj ``` @@ -89,7 +89,15 @@ This will generate an Xcode project in `build-ios/spine-cocos2dx-example.xcodepr Open the project in `proj.android` in Android Studio. Make sure you have NDK version `24.0.8215888` installed via the SDK Manager. Alternatively, you can set the `ndkVersion` property in `proj.android/app/build.gradle` to the NDK version you have installed locally. ### Windows -**TBD** +Execute the following on the command line: + +``` +cd spine-runtimes/spine-cocos2dx/example +mkdir build-win +cmake . -G "Visual Studio 16 2019" -A Win32 -T host=x86 -Bbuild-win +``` + +You can then open the file `build-win/spine-cocos2dx-example.sln` with Visual Studio 2019. In the solution explorer, right click the `spine-cocos2dx-example` project, then click `Set as Startup Project` in the context menu. Finally, click the `Local Windows Debugger` button to build and run the example. ## Notes