Skip to content

Commit

Permalink
fix vita build (except for network)
Browse files Browse the repository at this point in the history
  • Loading branch information
pionere committed Feb 7, 2024
1 parent 35dec69 commit 1bff931
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
19 changes: 7 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1007,19 +1007,14 @@ endif()
if(VITA)
target_link_libraries(${BIN_TARGET} PRIVATE
ScePower_stub
SceNet_stub
SceNetCtl_stub
freetype
png
m
z
FLAC
vorbisfile
vorbis
ogg
mikmod
mpg123
SceAppUtil_stub
)
if(NOT NONET)
target_link_libraries(${BIN_TARGET} PRIVATE
SceNet_stub
SceNetCtl_stub
)
endif()
#target_compile_definitions(${BIN_TARGET} PRIVATE VITA)
endif()

Expand Down
2 changes: 2 additions & 0 deletions Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#endif
#ifdef __vita__
#include <psp2/power.h>
#include "platform/vita/network.h"
#include "platform/vita/random.hpp"
#endif
#ifdef RUN_TESTS
#include <gtest/gtest.h>
Expand Down
9 changes: 8 additions & 1 deletion Source/platform/vita/network.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "platform/vita/network.h"

#ifndef NONET
#include <cstdlib>
#include <cstdio>
#include <unistd.h>
#include "platform/vita/network.h"
#include <psp2/sysmodule.h>
#include <psp2/net/net.h>
#include <psp2/net/netctl.h>
Expand Down Expand Up @@ -30,3 +32,8 @@ void vita_enable_network()
return;
}
}
#else
void vita_enable_network()
{
}
#endif // !NONET
8 changes: 8 additions & 0 deletions Source/platform/vita/random.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "random.hpp"

#ifndef NONET
#include <sys/types.h>
#include <sodium.h>
#include <psp2/kernel/rng.h>
Expand Down Expand Up @@ -32,3 +35,8 @@ void randombytes_vitarandom_init()
{
randombytes_set_implementation(&randombytes_vitarandom_implementation);
}
#else
void randombytes_vitarandom_init()
{
}
#endif // !NONET

0 comments on commit 1bff931

Please sign in to comment.