Remove SDL2 and other libraries

This commit is contained in:
angie 2024-06-04 11:13:39 -04:00
parent cb0af5cabd
commit ae53e8e372
4 changed files with 30 additions and 53 deletions

View file

@ -8,6 +8,7 @@ on:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
build-linux: build-linux:
runs-on: ${{ matrix.arch == 'x64' && 'ubuntu-22.04' || 'blaze/ubuntu-22.04' }} runs-on: ${{ matrix.arch == 'x64' && 'ubuntu-22.04' || 'blaze/ubuntu-22.04' }}
@ -30,26 +31,12 @@ jobs:
- name: Install Linux Dependencies - name: Install Linux Dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev lld llvm clang-15 sudo apt-get install -y ninja-build lld llvm clang-15
# Install SDL2
echo ::group::install SDL2
# Enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://www.libsdl.org/release/SDL2-2.26.1.tar.gz
tar -xzf SDL2-2.26.1.tar.gz
cd SDL2-2.26.1
./configure
make -j 10
sudo make install
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
echo ::endgroup::
- name: Generate CMake Project - name: Generate CMake Project
run: | run: |
# enable ccache # enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
- name: Build ultramodern - name: Build ultramodern
run: | run: |
@ -61,6 +48,7 @@ jobs:
# enable ccache # enable ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --build cmake-build --config ${{ matrix.type }} --target librecomp -j $(nproc) cmake --build cmake-build --config ${{ matrix.type }} --target librecomp -j $(nproc)
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
strategy: strategy:

View file

@ -27,4 +27,15 @@ Librecomp is a library meant to be used to bridge the gap between code generated
* Overlay handling * Overlay handling
* PI DMA (ROM reads) * PI DMA (ROM reads)
* EEPROM, SRAM and Flashram saving (these may be partially moved to ultramodern in the future) * EEPROM, SRAM and Flashram saving (these may be partially moved to ultramodern in the future)
## Building
It is recommended to reference this project on your `CMakeLists.txt` file. Note that this project has been developed with `clang` 15, older versions may not work.
For building locally this project (ie, developing new features for the libraries of this project), the following is recommneded:
```bash
cmake -B build -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j $(nproc) --config Debug
```

View file

@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 3.20) cmake_minimum_required(VERSION 3.20)
project(librecomp) project(librecomp)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS OFF)
# Define the library # Define the library
add_library(librecomp STATIC add_library(librecomp STATIC
@ -33,6 +37,10 @@ target_include_directories(librecomp PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/include/librecomp" "${CMAKE_CURRENT_SOURCE_DIR}/include/librecomp"
) )
target_compile_options(librecomp PRIVATE -Wno-deprecated-declarations) target_compile_options(librecomp PRIVATE
# -Wall
# -Wextra
-Wno-unused-parameter
)
target_link_libraries(librecomp PRIVATE ultramodern) target_link_libraries(librecomp PRIVATE ultramodern)

View file

@ -33,38 +33,8 @@ target_include_directories(ultramodern PUBLIC
"${PROJECT_SOURCE_DIR}/../thirdparty/sse2neon" "${PROJECT_SOURCE_DIR}/../thirdparty/sse2neon"
) )
if (WIN32) target_compile_options(ultramodern PRIVATE
include(FetchContent) # -Wall
# Fetch SDL2 on windows # -Wextra
FetchContent_Declare( -Wno-unused-parameter
sdl2 )
URL https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-devel-2.28.5-VC.zip
URL_HASH MD5=d8173db078e54040c666f411c5a6afff
)
FetchContent_MakeAvailable(sdl2)
target_include_directories(ultramodern PRIVATE
${sdl2_SOURCE_DIR}/include
)
target_link_directories(ultramodern PRIVATE
${sdl2_SOURCE_DIR}/lib/x64
)
add_compile_definitions(NOMINMAX)
elseif (APPLE)
find_package(SDL2 REQUIRED)
target_include_directories(ultramodern PRIVATE ${SDL2_INCLUDE_DIRS})
else()
find_package(SDL2 REQUIRED)
find_package(X11 REQUIRED)
message(STATUS "SDL2_FOUND = ${SDL2_FOUND}")
message(STATUS "SDL2_INCLUDE_DIRS = ${SDL2_INCLUDE_DIRS}")
target_include_directories(ultramodern PRIVATE ${SDL2_INCLUDE_DIRS})
message(STATUS "X11_FOUND = ${X11_FOUND}")
message(STATUS "X11_INCLUDE_DIR = ${X11_INCLUDE_DIR}")
message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}")
target_include_directories(ultramodern PRIVATE ${X11_INCLUDE_DIR})
target_link_libraries(ultramodern PRIVATE ${X11_LIBRARIES})
endif()