Implement support for building on Linux. Hopefully doesn't break Windows/macOS

This commit is contained in:
2025-08-29 13:09:24 -04:00
parent a9357b924d
commit e3af26a508
2 changed files with 12 additions and 1 deletions

View File

@@ -46,10 +46,20 @@ elseif(APPLE)
find_package(SDL2 REQUIRED CONFIG)
message(STATUS "Found SDL2 at: ${SDL2_DIR}")
elseif(UNIX)
elseif(UNIX AND NOT APPLE)
find_package(SDL2 CONFIG QUIET)
if(NOT SDL2_FOUND)
# Use pkg-config as fallback
find_package(PkgConfig REQUIRED)
pkg_check_modules(SDL2 REQUIRED sdl2)
add_library(SDL2::SDL2 UNKNOWN IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
IMPORTED_LOCATION "${SDL2_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
INTERFACE_COMPILE_OPTIONS "${SDL2_CFLAGS_OTHER}"
)
endif()
endif()

View File

@@ -5,6 +5,7 @@
#ifndef BUS_H
#define BUS_H
#include <algorithm>
#include <cstdint>
#include <vector>
// Memory Bus - handles memory mapping