Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Building psOff from scratch

SysRay edited this page Apr 6, 2024 · 7 revisions

Building psOff modules using VSCode

Warning

This guide assuming that you have all the Vulkan/MSVC/Clang stuff installed. If you don't have it follow the first two steps here and then return to this guide.

Preparing the environment

When you open psOff repository with VSCode for the first time, it will show you the notification about installing recommended extensions. You should click Show Recommenadtions there.

318287472-cf68c43d-880e-455d-861f-e79dd5fbc346

If you missed this notification, then press Ctrl+Shift+P and type Focus on Workspace Recommendations View and perss this button.

318287529-0f880db8-99d3-45a8-bf58-ffd670c83ae7

Now you'll see the sidebar with all the recommended extensions, you should install all of them. Or just press the Install Workspace Recommended Extensions button above, the one with the cloud icon.

318287782-f26d29ef-6d83-4dcd-9b6d-54a123f1730f

It is recommended to restart the VSCode after you finish installing all the recommended extensions.

All you have to do now is switch the default compiler to clang-cl if it didn't set automatically and set build target to Release.

319095888-07a06620-e44a-4ab9-a98d-d44abd770551 319095825-4b1c1821-d2b4-459f-905f-b06d057dcd38

Make sure the CMake Extension uses it too:

319096221-d801a28f-8e57-4c1a-9c66-f45861b78e7f

Warning

You won't be able to build the Debug version of emulator, you should switch CMake target to Release. But worry not, this target already uses debug symbols the only thing you should do to improve your debugging experience - disable compiler optimizations, open the main CMakeLists.txt file and change CMAKE_CXX_FLAGS_RELEASE flag -Ofast to -O0.

0ba33d03-31c7-4b36-814d-df8b5dd90545

525039ee-97e5-48d1-8aef-411e78c26466

If you reading this, it seems you all set! So now you can use VSCode to build psOff modules. Just press Ctrl+Shift+P and type CMake Focus and press CMake: Focus on Project Status View then click on the Configure button first:

319099796-446c7fb1-a4e7-4b21-8ce5-2a3586e95042

Then the Build one:

319099924-e890e20c-cc88-416c-8549-c55764a0dd88

You can add these command to Pinned Commands list and use them there:

319100276-1b83e2ed-d570-437a-bb2b-8b3ccd3cf084

In fact, the only button you need is Install. When you press it, cmake will configure the project, build it and then copy ready to use files to _build/_Install directory.

Clone this wiki locally