Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlayStation Vita support #359

Merged
merged 6 commits into from
Mar 11, 2023
Merged

PlayStation Vita support #359

merged 6 commits into from
Mar 11, 2023

Conversation

fgsfdsfgs
Copy link
Contributor

Adds PSVita support to both waf and cmake scripts. Complementary to FWGS/xash3d-fwgs#1251.
Building the libraries for psvita requires the same dependencies as building the engine for it.

Building with waf:

./waf configure -T release --psvita
./waf build

Building with CMake:

mkdir build && cd build
cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="$VITASDK/share/vita.toolchain.cmake" -DCMAKE_PROJECT_HLSDK-PORTABLE_INCLUDE="$VITASDK/share/vrtld_shim.cmake" ..
make -j

# this optimization is broken in vitasdk
cflags += ['-fno-optimize-sibling-calls']
# disable some ARM bullshit
cflags += ['-fsigned-char', '-fno-short-enums', '-Wno-attributes']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to build without -fsigned-char now.

But -fno-short-enums should be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-fsigned-char is actually the default in vitasdk gcc now, so removed.

cflags += ['-I%s/arm-vita-eabi/include/SDL2' % self.vitasdk_dir]
# the game wants GNU extensions
if cxx:
cflags += ['-std=gnu++17', '-D_GNU_SOURCE']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we enable _GNU_SOURCE only when we actually use it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't remember why I put that in. Removed.

# base include dir
cflags += ['-isystem %s/arm-vita-eabi/include' % self.vitasdk_dir]
# SDL include dir
cflags += ['-I%s/arm-vita-eabi/include/SDL2' % self.vitasdk_dir]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDL2 shouldn't be added globally here and instead be in uselib.

But this is a minor issue, I wouldn't change it right now but refactor it in engine later. Maybe I would do that myself.

@nekonomicon
Copy link
Member

@fgsfdsfgs please add build instructions to readme.md.

@a1batross
Copy link
Member

@nekonomicon do you really wanna pile up all build instructions in one single readme md file?

@nekonomicon
Copy link
Member

@fgsfdsfgs
Copy link
Contributor Author

@fgsfdsfgs please add build instructions to readme.md.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants