Skip to content

Develop on windows

i0gan edited this page May 4, 2024 · 5 revisions

Intro

It is recommended for development to use Virsual Studio 2022 above editor and VS code under the Windows platform to write code. This tool is also used for code debugging. It's very useful! But under windows development, the third-party library only has a Debug version.

Step 1. Prepare for the squick development

Before development, you need to download the corresponding toolkit, as follows:

Virsual Studio

Download link: https://visualstudio.microsoft.com/

Download latest Virtual Stduio version, such as Virsual Studio 2022. then install it.

Make sure you have installed the Desktop development with C++ workloads in virsual studio installer.

cmake

Download link: https://cmake.org/download/

When clicking Install, remember to select the Add environment variables option.

python3

Download link: https://www.python.org/downloads/windows/

When clicking Install, remember to select the Add environment variables option.

Step 2. Install third-party library

Enter the tools directory, Click the script clone_thirdparty_build.bat

If your network cannot clone from github, you can use browser to download it. for example:

Copy the entire build directory from https://github.com/pwnsky/squick-thirdparty-build/tree/main/Windows to the {project_path}/third_party directory.

so that you can't compile the third-party source code by yourself.

Step 3. sqkctl tool compilation

First, when compiling for the first time, compile the sqkctl tool first, enter the tool directory {project_path}/tools, and click build_sqkctl.bat to compile. After compilation

Step 4. Main project compilation

First, click generate_config.bat and proto2code.bat to generate the corresponding configuration file and proto code file.

Then click generate_vs_project.bat in the tools directory to generate the vs project project, It will auto show explore, you can use Virsual Studio to open {project_path}/cache/Project.sln. Just compile all projects. Or you can use build_squick.bat auto compile all projects.

After compilation is completed, the file directory is roughly as follows:

bin
β”œβ”€β”€ core.dll
...
β”œβ”€β”€ plugin
β”‚Β Β  β”œβ”€β”€ core
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ actor.dll
...
β”‚Β Β  └── node
...
β”œβ”€β”€ squick.exe
..

Step 5. Start the squick

If you use virsual studio editor, you just click Windows Local Debugger to run squick program

Also you can only run the program by script, click start.bat in {project_path}/script/ directory

If you wanna stop all squick process, just click stop.bat

Step 6. Package the squick project

Package to mini program for others to testing use.

Just click generate_deploy.bat

After running, all packaged files will be saved under {project_path}/deploy directory.