Skip to content

Instantly share code, notes, and snippets.

@umjammer
Last active March 27, 2023 01:02
Show Gist options
  • Select an option

  • Save umjammer/4cd148ac16e859bfe3a886db363afcc3 to your computer and use it in GitHub Desktop.

Select an option

Save umjammer/4cd148ac16e859bfe3a886db363afcc3 to your computer and use it in GitHub Desktop.
[emu] build np2kai sdl2 on mac

build np2kai w/ sdl2 on mac 2022-03-16

$ brew install cmake ninja sdl2 sdl2_mixer sdl2_ttf libusb     # ninja is needed ???
$ git clone https://github.com/AZO234/NP2kai.git
$ cd NP2kai
$ mkdir build
$ vi ../CMakeLists.txt
$ cmake .. -D BUILD_SDL=ON                                     # fails, but try again
 :
$ cmake .. -D BUILD_SDL=ON
 :
$ ls -l Makefile                                               # finally, makefile will be created
$ make -j
index 68f2009..84bd786 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -365,6 +365,8 @@ if(USE_ASYNCCPU)
        list(APPEND NP2kai_AsyncCPU_definitions "SUPPORT_ASYNC_CPU")
 endif()
 
+#set(SDL_INCLUDE_DIR "/usr/local/include/SDL")
+
 if(NOT CMAKE_CROSSCOMPILING)
 
        # math
@@ -385,6 +387,7 @@ if(NOT CMAKE_CROSSCOMPILING)
                                message(FATAL_ERROR "-- Not found SDL")
                        endif()
                endif()
+               set(SDL2_INCLUDE_DIR "/usr/local/include/SDL2")
                find_path(SDL2_CMAKE "FindSDL2.cmake" "cmake/sdl2-cmake-scripts")
                if(NOT SDL2_CMAKE)
                        execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${NP2kai_SOURCE_DIR}/cmake/sdl2-cmake-modules)
@@ -427,6 +430,8 @@ if(NOT CMAKE_CROSSCOMPILING)
                                message(FATAL_ERROR "-- Not found SDL_mixer")
                        endif()
                endif()
+               set(SDL2_INCLUDE_DIR "/usr/local/include/SDL2")
+               find_path(SDL2_CMAKE "FindSDL2.cmake" "cmake/sdl2-cmake-scripts")
                find_package(SDL2_mixer)
                if(USE_SDL_MIXER AND (USE_SDL_VERSION EQUAL 2))
                        if(NOT SDL2_mixer_FOUND)

TODO

  • screen size, volume menu grayed out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment