Platforms: Add FreeBSD support

This commit is contained in:
Er2
2023-12-02 18:37:38 +03:00
parent bd6cd95b66
commit 17b11a5b98
4 changed files with 9 additions and 7 deletions

View File

@@ -13,8 +13,8 @@ target_link_libraries(reminecraftpe-openal PUBLIC reminecraftpe-core)
if(EMSCRIPTEN)
target_link_libraries(reminecraftpe-openal PUBLIC openal)
else()
find_library(OPENAL_LIBRARY NAMES openal REQUIRED)
target_link_libraries(reminecraftpe-openal PUBLIC "${OPENAL_LIBRARY}")
find_package(OpenAL REQUIRED)
target_link_libraries(reminecraftpe-openal PUBLIC OpenAL::OpenAL)
endif()
# Headers

View File

@@ -10,8 +10,8 @@
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#include <al.h>
#include <alc.h>
#endif
#include <string>

View File

@@ -1,4 +1,5 @@
#include <cstdarg>
#include <libgen.h>
#include "thirdparty/SDL2/SDL2.h"
@@ -305,6 +306,9 @@ void CheckOptionalTextureAvailability()
// Main
int main(int argc, char *argv[])
{
// cd build; ./reminecraftpe otherwise
chdir(dirname(argv[0]));
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
LOG_E("Unable To Initialize SDL: %s", SDL_GetError());

View File

@@ -2,7 +2,5 @@
#ifdef _WIN32
#pragma comment(lib, "SDL2.lib")
#endif
#include <SDL.h>
#else
#include <SDL2/SDL.h>
#endif