some CMakeLists fixes and oldimpls directory fixes (ITS ABLE TO COMPILE, FINALLY!!1!)

This commit is contained in:
meowtech 2026-03-31 13:22:09 +00:00
parent b051416902
commit 16432add0b
4 changed files with 53 additions and 18 deletions

View file

@ -26,6 +26,7 @@ set(OLDIMPLS_SOURCE
# main stuff
set(MAIN_HEADERS
${OLDIMPLS_HEADERS}
src/quadarray.h
src/audio.h
src/binding.h
@ -85,10 +86,10 @@ set(MAIN_HEADERS
chromasdk/RzErrors.h
chromasdk/ChromaApi.h
src/i18n.h
${OLDIMPLS_HEADERS}
)
set(MAIN_SOURCE
${OLDIMPLS_SOURCE}
src/main.cpp
src/audio.cpp
src/bitmap.cpp
@ -128,7 +129,6 @@ set(MAIN_SOURCE
src/oneshot.cpp
src/screen.cpp
src/i18n.cpp
${OLDIMPLS_SOURCE}
)
if(WIN32)
@ -302,12 +302,13 @@ find_package(SDL3_image CONFIG)
find_package(SDL3_sound CONFIG)
find_package(SDL3_ttf CONFIG)
find_package(OpenAL CONFIG)
find_package(Boost REQUIRED COMPONENTS CONFIG)
find_package(Boost REQUIRED COMPONENTS program_options)
find_package(PhysFS CONFIG)
find_path(PIXMAN_INCLUDE_DIR NAMES pixman.h PATH_SUFFIXES pixman-1)
find_library(PIXMAN_LIBRARY NAMES pixman-1 pixman-1_static pixman-1_staticd)
find_package(Ruby REQUIRED)
pkg_check_modules(SIGC2 REQUIRED sigc++-2.0)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
find_package_handle_standard_args(pixman-1 DEFAULT_MSG PIXMAN_LIBRARY PIXMAN_INCLUDE_DIR)
if(PIXMAN-1_FOUND)
set(PIXMAN_LIBRARIES ${PIXMAN_LIBRARY})
@ -316,17 +317,34 @@ endif()
mark_as_advanced(PIXMAN_INCLUDE_DIR PIXMAN_LIBRARY)
target_compile_definitions(${PROJECT_NAME} PRIVATE ${DEFINES})
target_include_directories(${PROJECT_NAME} PRIVATE src ${PIXMAN_INCLUDE_DIRS} ${SIGC2_INCLUDE_DIRS} ${RUBY_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} Boost::boost)
target_link_libraries(${PROJECT_NAME} PRIVATE SDL3::SDL3 SDL3_image::SDL3_image SDL3_sound::SDL3_sound SDL3_ttf::SDL3_ttf Boost::boost OpenAL::OpenAL physfs ${PIXMAN_LIBRARIES} ${SIGC2_LIBRARIES} ${PLATFORM_LIBRARIES} ${RUBY_LIBRARIES})
target_compile_definitions(${PROJECT_NAME}
PRIVATE
${DEFINES})
target_include_directories(${PROJECT_NAME}
PRIVATE
src
${PIXMAN_INCLUDE_DIRS}
${SIGC2_INCLUDE_DIRS}
${Ruby_INCLUDE_DIRS}
Boost::boost ${Boost_INCLUDE_DIRS}
${VORBISFILE_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME}
PRIVATE
SDL3::SDL3 SDL3_image::SDL3_image SDL3_sound::SDL3_sound SDL3_ttf::SDL3_ttf
OpenAL::OpenAL
physfs
${PIXMAN_LIBRARIES}
${SIGC2_LIBRARIES}
${PLATFORM_LIBRARIES}
${Ruby_LIBRARIES}
Boost::boost ${Boost_LIBRARIES}
${VORBISFILE_LIBRARIES})
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ffast-math")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -ffast-math")
message(STATUS "Ruby found: ${RUBY_EXECUTABLE}")
message(STATUS "Ruby includes: ${RUBY_INCLUDE_DIRS}")
message(STATUS "Ruby libs: ${RUBY_LIBRARIES}")
IF(APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND cmake -P "${CMAKE_SOURCE_DIR}/patches/mac/CompleteBundle.cmake" VERBATIM)
ENDIF()

17
less Normal file
View file

@ -0,0 +1,17 @@
/usr/bin/cmake -S/home/meowtech/sources/mkxp-sunshine -B/home/meowtech/sources/mkxp-sunshine --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/meowtech/sources/mkxp-sunshine/CMakeFiles /home/meowtech/sources/mkxp-sunshine//CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/meowtech/sources/mkxp-sunshine'
make -f CMakeFiles/oneshot.dir/build.make CMakeFiles/oneshot.dir/depend
make[2]: Entering directory '/home/meowtech/sources/mkxp-sunshine'
cd /home/meowtech/sources/mkxp-sunshine && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/meowtech/sources/mkxp-sunshine /home/meowtech/sources/mkxp-sunshine /home/meowtech/sources/mkxp-sunshine /home/meowtech/sources/mkxp-sunshine /home/meowtech/sources/mkxp-sunshine/CMakeFiles/oneshot.dir/DependInfo.cmake "--color=" oneshot
Dependencies file "CMakeFiles/oneshot.dir/link.d" is newer than depends file "/home/meowtech/sources/mkxp-sunshine/CMakeFiles/oneshot.dir/compiler_depend.internal".
Consolidate compiler generated dependencies of target oneshot
make[2]: Leaving directory '/home/meowtech/sources/mkxp-sunshine'
make -f CMakeFiles/oneshot.dir/build.make CMakeFiles/oneshot.dir/build
make[2]: Entering directory '/home/meowtech/sources/mkxp-sunshine'
[ 1%] Linking CXX executable oneshot
/usr/bin/cmake -E cmake_link_script CMakeFiles/oneshot.dir/link.txt --verbose=1
/usr/bin/c++ -O3 -ffast-math -Wl,--dependency-file=CMakeFiles/oneshot.dir/link.d CMakeFiles/oneshot.dir/src/main.cpp.o CMakeFiles/oneshot.dir/src/audio.cpp.o CMakeFiles/oneshot.dir/src/bitmap.cpp.o CMakeFiles/oneshot.dir/src/eventthread.cpp.o CMakeFiles/oneshot.dir/src/filesystem.cpp.o CMakeFiles/oneshot.dir/src/font.cpp.o CMakeFiles/oneshot.dir/src/input.cpp.o CMakeFiles/oneshot.dir/src/plane.cpp.o CMakeFiles/oneshot.dir/src/scene.cpp.o CMakeFiles/oneshot.dir/src/sprite.cpp.o CMakeFiles/oneshot.dir/src/table.cpp.o CMakeFiles/oneshot.dir/src/tilequad.cpp.o CMakeFiles/oneshot.dir/src/viewport.cpp.o CMakeFiles/oneshot.dir/src/window.cpp.o CMakeFiles/oneshot.dir/src/texpool.cpp.o CMakeFiles/oneshot.dir/src/shader.cpp.o CMakeFiles/oneshot.dir/src/glstate.cpp.o CMakeFiles/oneshot.dir/src/tilemap.cpp.o CMakeFiles/oneshot.dir/src/autotiles.cpp.o CMakeFiles/oneshot.dir/src/graphics.cpp.o "CMakeFiles/oneshot.dir/src/gl-debug.cpp.o" CMakeFiles/oneshot.dir/src/etc.cpp.o CMakeFiles/oneshot.dir/src/config.cpp.o CMakeFiles/oneshot.dir/src/settingsmenu.cpp.o CMakeFiles/oneshot.dir/src/keybindings.cpp.o CMakeFiles/oneshot.dir/src/tileatlas.cpp.o CMakeFiles/oneshot.dir/src/sharedstate.cpp.o "CMakeFiles/oneshot.dir/src/gl-fun.cpp.o" "CMakeFiles/oneshot.dir/src/gl-meta.cpp.o" CMakeFiles/oneshot.dir/src/vertex.cpp.o CMakeFiles/oneshot.dir/src/soundemitter.cpp.o CMakeFiles/oneshot.dir/src/sdlsoundsource.cpp.o CMakeFiles/oneshot.dir/src/alstream.cpp.o CMakeFiles/oneshot.dir/src/audiostream.cpp.o CMakeFiles/oneshot.dir/src/rgssad.cpp.o CMakeFiles/oneshot.dir/src/vorbissource.cpp.o CMakeFiles/oneshot.dir/src/oneshot.cpp.o CMakeFiles/oneshot.dir/src/screen.cpp.o CMakeFiles/oneshot.dir/src/i18n.cpp.o "CMakeFiles/oneshot.dir/src/oldimpls/sdl/rgb-surfaces.cpp.o" "CMakeFiles/oneshot.dir/src/xdg-user-dir-lookup.c.o" "CMakeFiles/oneshot.dir/binding-mri/binding-mri.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/binding-util.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/table-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/etc-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/bitmap-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/font-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/graphics-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/input-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/sprite-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/viewport-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/plane-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/window-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/tilemap-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/audio-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/module_rpg.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/filesystem-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/oneshot-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/steam-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/wallpaper-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/journal-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/chroma-binding.cpp.o" "CMakeFiles/oneshot.dir/binding-mri/niko-binding.cpp.o" -o oneshot /usr/lib/libSDL3_image.so.0.4.0 /usr/lib/libSDL3_sound.so.0.0.0 /usr/lib/libSDL3_ttf.so.0.2.2 /usr/lib/libopenal.so -lphysfs /usr/lib/libpixman-1.so -L/usr/lib -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lcairo-gobject -lgdk_pixbuf-2.0 -latk-1.0 -lpango-1.0 -lcairo -lharfbuzz -lxfconf-0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lz /usr/lib/libSDL3.so.0.4.2
make[2]: Leaving directory '/home/meowtech/sources/mkxp-sunshine'
make[1]: Leaving directory '/home/meowtech/sources/mkxp-sunshine'

View file

@ -3,9 +3,9 @@
#ifndef _OLDIMPLS_SDL_INCLUDE_H
#define _OLDIMPLS_SDL_INCLUDE_H
static SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
static SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format);
static SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
static SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format);
SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format);
SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format);
#endif

View file

@ -2,25 +2,25 @@
// taken from: https://wiki.libsdl.org/SDL3/README-migration#sdl_surfaceh
static SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
{
return SDL_CreateSurface(width, height,
SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask));
}
static SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format)
SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format)
{
return SDL_CreateSurface(width, height, (SDL_PixelFormat)format);
}
static SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
{
return SDL_CreateSurfaceFrom(width, height,
SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask),
pixels, pitch);
}
static SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format)
SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format)
{
return SDL_CreateSurfaceFrom(width, height, (SDL_PixelFormat)format, pixels, pitch);
}