SoniCPort (Sonic 1 C Port)

Discussion in 'Engineering & Reverse Engineering' started by CuckyDev, Feb 17, 2021.

Tags:
  1. CuckyDev

    CuckyDev

    Member
    10
    18
    3
    You'll need to have SDL2 installed on your package manager. I'm not sure how it'd work with Visual Studio, though.
     
  2. kcowolf

    kcowolf

    Oldbie
    22
    2
    3
    For Visual Studio, I use the VC development libraries from https://www.libsdl.org/download-2.0.php. I put the following sdl2-config.cmake file in the SDL2-2.0.14 directory:
    Code (Text):
    1. set(SDL2_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/include")
    2.  
    3. # Support both 32 and 64 bit builds
    4. if (${CMAKE_SIZEOF_VOID_P} MATCHES 8)
    5.   set(SDL2_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lib/x64/SDL2.lib;${CMAKE_CURRENT_LIST_DIR}/lib/x64/SDL2main.lib")
    6. else ()
    7.   set(SDL2_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lib/x86/SDL2.lib;${CMAKE_CURRENT_LIST_DIR}/lib/x86/SDL2main.lib")
    8. endif ()
    9.  
    10. string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
    Then I added -DSDL2_DIR=YOUR_PATH_HERE\SDL2-2.0.14 to the end of my cmake arguments:
     
  3. Yep, this worked! Thank you!
     
  4. Clownacy

    Clownacy

    Tech Member
    811
    45
    28
    For my builds, I used vcpkg to get SDL2. It essentially gives MSVC a package manager, though it's a little complicated to figure out.