Add missing #define CALLSTYLE and missing #include <cassert> to PGE Header file. Fast-forward to Moro's updated PGE cmake template which removes SDL2 dependency for Apple devices. Currently still not compiling.

mac-build
sigonasr2 4 months ago
parent 77d77f3030
commit 8efb5a9f8f
  1. 1
      Adventures in Lestoria/olcPixelGameEngine.h
  2. 52
      CMakeLists.txt

@ -1459,6 +1459,7 @@ namespace X11 {
#include <OpenGL/OpenGL.h> #include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#include <OpenGL/glu.h> #include <OpenGL/glu.h>
#define CALLSTYLE
#endif #endif
#if defined(OLC_PLATFORM_EMSCRIPTEN) #if defined(OLC_PLATFORM_EMSCRIPTEN)

@ -15,9 +15,6 @@ add_compile_options("-O2")
# Options you can set via command-line # Options you can set via command-line
option(HAS_TERMINAL "Show a terminal window for STDOUT/STDERR" ON) option(HAS_TERMINAL "Show a terminal window for STDOUT/STDERR" ON)
option(USE_ALSA "Force using ALSA as audio backend (Linux-only)")
option(USE_PULSEAUDIO "Force using PulseAudio as audio backend (Linux-only)")
option(USE_SDL2_MIXER "Force using SDL2_mixer as audio backend")
# #
# C_CXX_SOURCES_DIR # C_CXX_SOURCES_DIR
@ -133,8 +130,6 @@ if(APPLE)
target_link_libraries(${OutputExecutable} Threads::Threads) target_link_libraries(${OutputExecutable} Threads::Threads)
include_directories(${Threads_INCLUDE_DIRS}) include_directories(${Threads_INCLUDE_DIRS})
# SDL2_mixer
set(USE_SDL2_MIXER ON)
find_package(PNG REQUIRED) find_package(PNG REQUIRED)
target_link_libraries(${OutputExecutable} PNG::PNG) target_link_libraries(${OutputExecutable} PNG::PNG)
@ -169,14 +164,6 @@ if(WIN32 AND MINGW)
set(DWMAPI_LIBRARY dwmapi) set(DWMAPI_LIBRARY dwmapi)
target_link_libraries(${OutputExecutable} ${DWMAPI_LIBRARY}) target_link_libraries(${OutputExecutable} ${DWMAPI_LIBRARY})
if(NOT USE_SDL2_MIXER)
# winmm
set(WINMM_LIBRARY winmm)
target_link_libraries(${OutputExecutable} ${WINMM_LIBRARY})
endif() # NOT USE_SDL2_MIXER
# stdc++fs # stdc++fs
target_link_libraries(${OutputExecutable} stdc++fs) target_link_libraries(${OutputExecutable} stdc++fs)
@ -268,33 +255,6 @@ if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
target_include_directories(${OutputExecutable} PRIVATE "${C_CXX_SOURCES_DIR}/steam") target_include_directories(${OutputExecutable} PRIVATE "${C_CXX_SOURCES_DIR}/steam")
link_directories("Adventures in Lestoria") link_directories("Adventures in Lestoria")
# TODO: sanity checks
if(USE_ALSA)
# ALSA
find_package(ALSA REQUIRED)
target_link_libraries(${OutputExecutable} ALSA::ALSA)
include_directories(${ALSA_INCLUDE_DIRS})
add_compile_definitions(SOUNDWAVE_USING_ALSA=1)
elseif(USE_SDL2_MIXER)
# Because SDL2_mixer can be used on multiple platforms, we
# defer it's inclusion until outside of the platform/toolchain
# selection logic.
else() # PulseAudio is Default
# PulseAudio
find_package(PulseAudio REQUIRED)
target_link_libraries(${OutputExecutable} ${PULSEAUDIO_LIBRARY} pulse-simple)
include_directories(${PULSEAUDIO_INCLUDE_DIR})
add_compile_definitions(SOUNDWAVE_USING_PULSE=1)
endif()
find_package(PNG REQUIRED) find_package(PNG REQUIRED)
target_link_libraries(${OutputExecutable} PNG::PNG) target_link_libraries(${OutputExecutable} PNG::PNG)
include_directories(${PNG_INCLUDE_DIRS}) include_directories(${PNG_INCLUDE_DIRS})
@ -309,6 +269,7 @@ if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
target_link_libraries(${OutputExecutable} discord_game_sdk) target_link_libraries(${OutputExecutable} discord_game_sdk)
target_link_libraries(${OutputExecutable} libsteam_api) target_link_libraries(${OutputExecutable} libsteam_api)
target_link_libraries(${OutputExecutable} dl)
target_link_options( target_link_options(
${OutputExecutable} ${OutputExecutable}
@ -368,17 +329,6 @@ if (EMSCRIPTEN)
endif() # Emscripten endif() # Emscripten
if(USE_SDL2_MIXER AND NOT EMSCRIPTEN)
# SDL2_mixer
find_package(SDL2_mixer REQUIRED)
target_link_libraries(${OutputExecutable} SDL2_mixer::SDL2_mixer)
add_compile_definitions(SOUNDWAVE_USING_SDLMIXER=1)
endif() # USE_SDL2_MIXER
###################################################################### ######################################################################
# Set include directory # Set include directory
###################################################################### ######################################################################

Loading…
Cancel
Save