From 2fc4fb3d68d74b71690aa6633e33cd6d95a82fe5 Mon Sep 17 00:00:00 2001 From: Er2 Date: Sun, 7 Apr 2024 17:14:28 +0300 Subject: [PATCH] CI: Try to fix build --- .github/workflows/build.yml | 95 ++++++++++++++------- CMakeLists.txt | 44 ++++------ build-wasm.bat | 18 +--- build-wasm.sh | 15 +--- compat/LegacyCPPCompatibility.hpp | 3 + compat/SDLKeyCodes.h | 8 ++ platforms/ios/AppPlatform_iOS.mm | 5 ++ platforms/openal/SoundSystemAL.cpp | 15 ++-- platforms/openal/SoundSystemAL.hpp | 7 +- platforms/sdl/CMakeLists.txt | 4 +- platforms/sdl/android/app/build.gradle | 2 +- platforms/sdl/base/AppPlatform_sdl_base.cpp | 5 ++ platforms/sdl/main.cpp | 6 +- source/client/CMakeLists.txt | 6 +- source/client/sound/SoundSystem.cpp | 3 +- source/client/sound/SoundSystem.hpp | 2 +- source/common/CMakeLists.txt | 8 +- source/common/Utils.hpp | 1 + source/renderer/CMakeLists.txt | 6 ++ source/world/level/path/BinaryHeap.cpp | 2 +- thirdparty/GL/GL.hpp | 6 +- thirdparty/SDL2/SDL2.h | 7 +- thirdparty/SDL2/SDL_opengl.h | 7 +- 23 files changed, 161 insertions(+), 114 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ad9186..eb0c90c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,15 +10,15 @@ jobs: fail-fast: false matrix: include: - - name: OpenGL ES - flags: "-DUSE_GLES1_COMPATIBILITY_LAYER=ON" + - name: OpenGLES + render: gles - name: OpenGL - flags: "-DUSE_GLES1_COMPATIBILITY_LAYER=OFF" + render: gl name: Linux (${{ matrix.name }}) runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install Dependencies @@ -27,17 +27,44 @@ jobs: sudo apt-get install --no-install-recommends -y build-essential cmake ninja-build libopenal-dev libsdl2-dev zlib1g-dev - name: Build run: | - cd platforms/sdl - mkdir build - cd build - cmake -GNinja ${{ matrix.flags }} .. - cmake --build . + cmake -GNinja -S. -Bbuild -Drender=${{ matrix.render }} + cmake --build build + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ReMinecraftPE-Linux-${{ matrix.name }} + path: build/app + windows: + strategy: + fail-fast: false + matrix: + include: + - name: SDL + platform: sdl + - name: Native + platform: windows + name: Windows (${{ matrix.name }}) + runs-on: windows-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + submodules: true + - name: Build + run: | + cmake -S. -Bbuild -Dplatform=${{ matrix.platform }} + cmake --build build + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ReMinecraftPE-Windows-${{ matrix.name }} + path: build/app wasm: name: WASM runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install Dependencies @@ -46,37 +73,47 @@ jobs: sudo apt-get install --no-install-recommends -y cmake ninja-build - name: Build run: ./build-wasm.sh + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ReMinecraftPE-WASM + path: wasm/dist macos: name: macOS runs-on: macos-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - - name: Install MacPorts - uses: melusina-org/setup-macports@v1 - name: Install Dependencies + run: brew install sdl2 libpng + - name: Build run: | - sudo port install libsdl2 +universal - sudo port install libpng +universal - - name: Build macOS Archive - run: | - cd platforms/macos/projects/Minecraft - xcodebuild -scheme "MinecraftClient.SDL2" \ - -archivePath $RUNNER_TEMP/GitHubActions_MacOS_SDL2.xcarchive \ - -sdk macosx \ - -configuration "Release (Default)" \ - -destination generic/platform=macOS \ - GCC_PREPROCESSOR_DEFINITIONS='MISSING_SOUND_DATA $(GCC_PREPROCESSOR_DEFINITIONS)' \ - -quiet \ - clean archive + cmake -S. -Bbuild + cmake --build build + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ReMinecraftPE-macOS + path: build/app + #- name: Build macOS Archive + # run: | + # cd platforms/macos/projects/Minecraft + # xcodebuild -scheme "MinecraftClient.SDL2" \ + # -archivePath $RUNNER_TEMP/GitHubActions_MacOS_SDL2.xcarchive \ + # -sdk macosx \ + # -configuration "Release (Default)" \ + # -destination generic/platform=macOS \ + # GCC_PREPROCESSOR_DEFINITIONS='MISSING_SOUND_DATA $(GCC_PREPROCESSOR_DEFINITIONS)' \ + # -quiet \ + # clean archive # @NOTE: Newer versions of Xcode will complain and refuse to build old XIB files or target old iOS versions #ios: # runs-on: macos-latest # steps: # - name: Checkout Repository - # uses: actions/checkout@v3 + # uses: actions/checkout@v4 # with: # submodules: true # - name: Build iOS Archive @@ -103,11 +140,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Setup JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' diff --git a/CMakeLists.txt b/CMakeLists.txt index 736b20a..cee657c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,9 @@ if (ANDROID) elseif (WIN32) set(_DEFAULT_PLAT windows) set(_DEFAULT_RENDER gl) # TODO: DirectX +elseif (EMSCRIPTEN) + set(_DEFAULT_PLAT sdl) + set(_DEFAULT_RENDER gles) else() set(_DEFAULT_PLAT sdl) set(_DEFAULT_RENDER gl) @@ -41,14 +44,14 @@ elseif (EMSCRIPTEN) # Code should be built with -pthread to use pthread add_compile_options(-pthread) add_link_options(-pthread) + set(CMAKE_EXECUTABLE_SUFFIX ".js") + add_link_options("$<$:-gsource-map>") endif() if (platform STREQUAL android) # set -fPIC set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) set(USE_NATIVE_ANDROID 1) add_compile_definitions(USE_NATIVE_ANDROID) -elseif (platform STREQUAL macos) - message(FATAL_ERROR "${PLATFORM} currently can't be built using cmake. Use XCode instead") elseif (platform STREQUAL sdl) set(USE_SDL 1) add_compile_definitions(USE_SDL) @@ -57,12 +60,12 @@ elseif (platform STREQUAL sdl) # add_compile_definitions(SERVER) endif() -if (WIN32 OR ANDROID OR EMSCRIPTEN) +if (WIN32 OR ANDROID) set(USE_GLES1_COMPATIBILITY_LAYER FALSE CACHE BOOL "" FORCE) -elseif (NOT EMSCRIPTEN AND NOT ANDROID) - option(USE_GLES1_COMPATIBILITY_LAYER "Whether To Enable The GLESv1_CM Compatibility Layer" TRUE) -else() +elseif (platform STREQUAL gles) set(USE_GLES1_COMPATIBILITY_LAYER TRUE CACHE BOOL "" FORCE) +else() + option(USE_GLES1_COMPATIBILITY_LAYER "Whether To Enable The GLESv1_CM Compatibility Layer" TRUE) endif() if (USE_GLES1_COMPATIBILITY_LAYER OR platform STREQUAL sdl) # Prepare SDL library @@ -72,33 +75,20 @@ if (USE_GLES1_COMPATIBILITY_LAYER OR platform STREQUAL sdl) endif() endif() -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/app") +if (EMSCRIPTEN) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/wasm/dist") + file(MAKE_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + file(INSTALL "platforms/sdl/emscripten/wasm_shell.html" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + file(INSTALL "thirdparty/coi-serviceworker/coi-serviceworker.min.js" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +else() + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/app") +endif() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") -# WASM -if (EMSCRIPTEN) - function(add_compile_and_link_options) - add_compile_options(${ARGV}) - add_link_options(${ARGV}) - endfunction() - set(CMAKE_EXECUTABLE_SUFFIX ".js") - add_link_options("$<$:-gsource-map>") -endif() - -# Threads -if (EMSCRIPTEN) - add_compile_and_link_options(-pthread) -elseif (WIN32) - # using winapi so no pthread -else() - find_package(Threads) - link_libraries(Threads::Threads) -endif() - # Platforms if ("${platform}" IN_LIST PLATFORMS) add_subdirectory(platforms/${platform}) diff --git a/build-wasm.bat b/build-wasm.bat index b88d488..f19863d 100644 --- a/build-wasm.bat +++ b/build-wasm.bat @@ -21,35 +21,25 @@ echo * Creating output directory. del /s /q dist md dist -::create build directory -echo * Creating build directory -md build -cd build - ::note: Why the hell do I need to pop it into a separate window? When I don't, the batch ::file just stops... ::configure build echo * Configuring build. -start emcmake cmake -GNinja "$@" ..\..\platforms/sdl +start emcmake cmake -S.. -Bbuild -GNinja "$@" echo * PRESS ANY KEY when emcmake is done. pause > nul ::build echo * Starting build. -cmake --build . +cmake --build build :: echo * PRESS ANY KEY when CMake is done. --- Seems like we don't need that for cmake itself. :: pause > nul -::bundle -echo * Copying bundle data over. -copy reminecraftpe.* ..\dist -copy ..\..\platforms\sdl\emscripten\wasm_shell.html ..\dist\reminecraftpe.html -copy ..\..\thirdparty\coi-serviceworker\coi-serviceworker.min.js ..\dist - ::for me only echo * Copying to your webserver. -xcopy /E /Y ..\dist\ %WEBSRVROOT%\dist\ +xcopy /E /Y dist\ %WEBSRVROOT%\dist\ +move %WEBSRVROOT%\dist\wasm_shell.html %WEBSRVROOT%\dist\reminecraftpe.html ::cd back echo * And we are done!! diff --git a/build-wasm.sh b/build-wasm.sh index bc12657..33d605f 100755 --- a/build-wasm.sh +++ b/build-wasm.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e @@ -26,17 +26,8 @@ cd ../ rm -rf dist mkdir dist -# Create Build Directory -mkdir -p build -cd build - # Configure Build -emcmake cmake -GNinja "$@" ../../platforms/sdl +emcmake cmake -GNinja -S.. -Bbuild "$@" # Build -cmake --build . - -# Bundle -cp reminecraftpe.* ../dist -cp ../../platforms/sdl/emscripten/wasm_shell.html ../dist/reminecraftpe.html -cp ../../thirdparty/coi-serviceworker/coi-serviceworker.min.js ../dist +cmake --build build diff --git a/compat/LegacyCPPCompatibility.hpp b/compat/LegacyCPPCompatibility.hpp index fd7f669..ddfd43a 100644 --- a/compat/LegacyCPPCompatibility.hpp +++ b/compat/LegacyCPPCompatibility.hpp @@ -10,4 +10,7 @@ #ifndef override #define override #endif +#ifndef noexcept +#define noexcept +#endif #endif \ No newline at end of file diff --git a/compat/SDLKeyCodes.h b/compat/SDLKeyCodes.h index 965d130..c4d74fa 100644 --- a/compat/SDLKeyCodes.h +++ b/compat/SDLKeyCodes.h @@ -241,7 +241,15 @@ CODE(APP1) CODE(APP2) CODE(AUDIOREWIND) CODE(AUDIOFASTFORWARD) +#ifdef SDL_SCANCODE_SOFTLEFT CODE(SOFTLEFT) +#endif +#ifdef SDL_SCANCODE_SOFTRIGHT CODE(SOFTRIGHT) +#endif +#ifdef SDL_SCANCODE_CALL CODE(CALL) +#endif +#ifdef SDL_SCANCODE_ENDCALL CODE(ENDCALL) +#endif diff --git a/platforms/ios/AppPlatform_iOS.mm b/platforms/ios/AppPlatform_iOS.mm index 59b951c..a38a84f 100644 --- a/platforms/ios/AppPlatform_iOS.mm +++ b/platforms/ios/AppPlatform_iOS.mm @@ -38,6 +38,11 @@ void AppPlatform_iOS::initSoundSystem() { LOG_E("Trying to initialize SoundSystem more than once!"); } + if (m_pSoundSystem && !m_pSoundSystem->startEngine()) + { + LOG_E("Unable to load Audio Engine"); + m_pSoundSystem = nullptr; + } } AppPlatform_iOS::~AppPlatform_iOS() diff --git a/platforms/openal/SoundSystemAL.cpp b/platforms/openal/SoundSystemAL.cpp index fac49ac..be3e3d2 100644 --- a/platforms/openal/SoundSystemAL.cpp +++ b/platforms/openal/SoundSystemAL.cpp @@ -8,13 +8,11 @@ SoundSystemAL::SoundSystemAL() _initialized = false; _listenerVolume = 1.0; _audioMuted = false; - - startEngine(); } SoundSystemAL::~SoundSystemAL() { - stopEngine(); + SoundSystemAL::stopEngine(); } // Error Checking @@ -271,15 +269,15 @@ void SoundSystemAL::playAt(const SoundDesc& sound, float x, float y, float z, fl _sources.push_back(al_source); } -void SoundSystemAL::startEngine() +bool SoundSystemAL::startEngine() { - if (_initialized) return; + if (_initialized) return true; _device = alcOpenDevice(NULL); if (!_device) { LOG_E("Unable To Load Audio Engine"); - return; + return false; } // Create Context @@ -288,7 +286,7 @@ void SoundSystemAL::startEngine() if (err != ALC_NO_ERROR) { LOG_E("Unable To Open Audio Context: %s", alcGetString(_device, err)); - return; + return false; } // Select Context @@ -297,7 +295,7 @@ void SoundSystemAL::startEngine() if (err != ALC_NO_ERROR) { LOG_E("Unable To Select Audio Context: %s", alcGetString(_device, err)); - return; + return false; } // Set Distance Model @@ -305,6 +303,7 @@ void SoundSystemAL::startEngine() // Mark As loaded _initialized = true; + return true; } void SoundSystemAL::stopEngine() diff --git a/platforms/openal/SoundSystemAL.hpp b/platforms/openal/SoundSystemAL.hpp index 9918e83..e4660e0 100644 --- a/platforms/openal/SoundSystemAL.hpp +++ b/platforms/openal/SoundSystemAL.hpp @@ -3,12 +3,15 @@ #ifdef USE_OPENAL #ifdef _WIN32 +#pragma comment( lib, "OpenAL32.lib" ) #include #include -#pragma comment( lib, "OpenAl32.lib" ) #elif defined(__APPLE__) #include #include +#elif defined(__EMSCRIPTEN__) +#include +#include #else #include #include @@ -36,7 +39,7 @@ public: virtual void setListenerPos(float x, float y, float z); virtual void setListenerAngle(float yaw, float pitch); - virtual void startEngine(); + virtual bool startEngine(); virtual void stopEngine(); virtual void muteAudio(); virtual void unMuteAudio(); diff --git a/platforms/sdl/CMakeLists.txt b/platforms/sdl/CMakeLists.txt index c9a49e7..7aa9fde 100644 --- a/platforms/sdl/CMakeLists.txt +++ b/platforms/sdl/CMakeLists.txt @@ -53,8 +53,8 @@ if(ANDROID OR WIN32) elseif(EMSCRIPTEN) message(STATUS "Emscripten's SDL2") set(SDL_FLAG -sUSE_SDL=2) - target_compile_options(SDL "${SDL_FLAG}") - target_link_options(SDL "${SDL_FLAG}") + target_compile_options(SDL INTERFACE "${SDL_FLAG}") + target_link_options(SDL INTERFACE "${SDL_FLAG}") else() message(STATUS "System SDL2") find_package(SDL2 REQUIRED) diff --git a/platforms/sdl/android/app/build.gradle b/platforms/sdl/android/app/build.gradle index dddb581..f08bc84 100644 --- a/platforms/sdl/android/app/build.gradle +++ b/platforms/sdl/android/app/build.gradle @@ -33,7 +33,7 @@ android { } externalNativeBuild { cmake { - path '../../CMakeLists.txt' + path '../../../../CMakeLists.txt' version '3.22.1' } } diff --git a/platforms/sdl/base/AppPlatform_sdl_base.cpp b/platforms/sdl/base/AppPlatform_sdl_base.cpp index 5190727..709a6ef 100644 --- a/platforms/sdl/base/AppPlatform_sdl_base.cpp +++ b/platforms/sdl/base/AppPlatform_sdl_base.cpp @@ -64,6 +64,11 @@ void AppPlatform_sdl_base::initSoundSystem() { LOG_E("Trying to initialize SoundSystem more than once!"); } + if (m_pSoundSystem && !m_pSoundSystem->startEngine()) + { + LOG_E("Unable to load Audio Engine"); + m_pSoundSystem = nullptr; + } } std::string AppPlatform_sdl_base::getDateString(int time) diff --git a/platforms/sdl/main.cpp b/platforms/sdl/main.cpp index e889d30..a697b55 100644 --- a/platforms/sdl/main.cpp +++ b/platforms/sdl/main.cpp @@ -10,7 +10,9 @@ #include "emscripten/AppPlatform_sdl.hpp" #else #include "desktop/AppPlatform_sdl.hpp" -#include +# ifndef _MSC_VER +# include +# endif #endif typedef AppPlatform_sdl UsedAppPlatform; @@ -308,7 +310,7 @@ void CheckOptionalTextureAvailability() // Main int main(int argc, char *argv[]) { -#ifndef __EMSCRIPTEN__ +#if !defined(__EMSCRIPTEN__) && !defined(_MSC_VER) // automatically change dir to avoid missing files and manual cd command chdir(dirname(argv[0])); #endif diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index cff95e1..a8d6a69 100644 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -104,7 +104,5 @@ if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../sound_data/sounds.h") target_compile_definitions(Client PRIVATE MISSING_SOUND_DATA) endif() -target_link_libraries(Client PUBLIC - Gui - Renderer -) +target_link_libraries(Client PUBLIC Renderer Gui) +target_link_libraries(Client PRIVATE Server World) diff --git a/source/client/sound/SoundSystem.cpp b/source/client/sound/SoundSystem.cpp index 9fb0234..c44e33e 100644 --- a/source/client/sound/SoundSystem.cpp +++ b/source/client/sound/SoundSystem.cpp @@ -45,8 +45,9 @@ void SoundSystem::playAt(const SoundDesc& sound, float x, float y, float z, floa { } -void SoundSystem::startEngine() +bool SoundSystem::startEngine() { + return false; } void SoundSystem::stopEngine() diff --git a/source/client/sound/SoundSystem.hpp b/source/client/sound/SoundSystem.hpp index 3192fa5..dbafacd 100644 --- a/source/client/sound/SoundSystem.hpp +++ b/source/client/sound/SoundSystem.hpp @@ -26,7 +26,7 @@ public: virtual void playAt(const SoundDesc& sound, float x, float y, float z, float a, float b); // Be prepared for these to be called regardless of engine state - virtual void startEngine(); + virtual bool startEngine(); virtual void stopEngine(); virtual void muteAudio(); diff --git a/source/common/CMakeLists.txt b/source/common/CMakeLists.txt index 56a9437..4756344 100644 --- a/source/common/CMakeLists.txt +++ b/source/common/CMakeLists.txt @@ -14,7 +14,11 @@ add_library(Common STATIC ../../GameMods.hpp ) -#target_link_libraries(Common PRIVATE Renderer) +# Threads +if (NOT WIN32 AND NOT EMSCRIPTEN) + find_package(Threads REQUIRED) + target_link_libraries(Common PRIVATE Threads::Threads) +endif() # zlib if (WIN32) @@ -25,7 +29,7 @@ elseif (EMSCRIPTEN) # Use Emscripten's ZLib set(ZLIB_FLAG -sUSE_ZLIB=1) target_compile_options(Common PUBLIC "${ZLIB_FLAG}") - target_link_options(Common PRIVATE "${ZLIB_FLAG}") + target_link_options(Common PUBLIC "${ZLIB_FLAG}") else() # Use System ZLib find_package(ZLIB REQUIRED) diff --git a/source/common/Utils.hpp b/source/common/Utils.hpp index 0806983..05d6aa0 100644 --- a/source/common/Utils.hpp +++ b/source/common/Utils.hpp @@ -11,6 +11,7 @@ #include #include // have to include this to avoid it being included again later from being a problem #include +#include #include #include #include diff --git a/source/renderer/CMakeLists.txt b/source/renderer/CMakeLists.txt index 6caf5af..041c4f4 100644 --- a/source/renderer/CMakeLists.txt +++ b/source/renderer/CMakeLists.txt @@ -15,6 +15,12 @@ endif() #target_include_directories(Renderer PUBLIC .) target_include_directories(Renderer PRIVATE ../..) +if (WIN32) + target_include_directories(Renderer PUBLIC ../../thirdparty) +else() + target_include_directories(Renderer PRIVATE ../../thirdparty) +endif() + # Find OpenGL library if (USE_GLES1_COMPATIBILITY_LAYER) message(STATUS "GLESv1 compatibility layer") diff --git a/source/world/level/path/BinaryHeap.cpp b/source/world/level/path/BinaryHeap.cpp index d2501e5..feffe8b 100644 --- a/source/world/level/path/BinaryHeap.cpp +++ b/source/world/level/path/BinaryHeap.cpp @@ -5,7 +5,7 @@ The following code is licensed under the BSD 1 clause license. SPDX-License-Identifier: BSD-1-Clause ********************************************************************/ -#include +#include #include "BinaryHeap.hpp" #include "common/Mth.hpp" diff --git a/thirdparty/GL/GL.hpp b/thirdparty/GL/GL.hpp index 2494b0d..daf2a81 100644 --- a/thirdparty/GL/GL.hpp +++ b/thirdparty/GL/GL.hpp @@ -46,7 +46,11 @@ #define GL_GLEXT_PROTOTYPES #include "thirdparty/SDL2/SDL_opengl.h" - #include + #ifdef __linux__ + #include + #else + #include + #endif #else #ifdef __APPLE__ #include diff --git a/thirdparty/SDL2/SDL2.h b/thirdparty/SDL2/SDL2.h index 28fde6c..8b9bc32 100644 --- a/thirdparty/SDL2/SDL2.h +++ b/thirdparty/SDL2/SDL2.h @@ -1,6 +1,7 @@ #pragma once -#ifdef _WIN32 -#pragma comment(lib, "SDL2.lib") -#endif +#ifdef __linux__ +#include +#else #include +#endif diff --git a/thirdparty/SDL2/SDL_opengl.h b/thirdparty/SDL2/SDL_opengl.h index 0e1a310..eba04a8 100644 --- a/thirdparty/SDL2/SDL_opengl.h +++ b/thirdparty/SDL2/SDL_opengl.h @@ -1,8 +1,7 @@ #pragma once -#ifdef _WIN32 -#pragma comment(lib, "SDL2.lib") -#include -#else +#ifdef __linux__ #include +#else +#include #endif