Skip to content
Snippets Groups Projects
Commit da394a87 authored by Logan Aerl Arias's avatar Logan Aerl Arias
Browse files

add Visual Studio 2022 support (via CMAKE)

parent 279820cd
Branches
No related tags found
No related merge requests found
......@@ -6,8 +6,6 @@
"description": "Build using default generator",
"binaryDir": "build",
"cacheVariables": {
"CMAKE_C_FLAGS": "-fdiagnostics-color",
"CMAKE_CXX_FLAGS": "-fdiagnostics-color",
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
......
set(CPM_DOWNLOAD_VERSION 0.36.0)
set(CPM_DOWNLOAD_VERSION 0.38.7)
if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
......
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
set(CMAKE_BINARY_DIR "${BINARY_DIR}")
set(CMAKE_CURRENT_BINARY_DIR "${BINARY_DIR}")
......
......@@ -58,6 +58,10 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin)
)
endif()
if("${CMAKE_SYSTEM_NAME}" MATCHES Windows)
target_link_libraries(SRB2SDL2 PRIVATE SDL2::SDL2main)
endif()
if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}" AND NOT "${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}")
target_link_libraries(SRB2SDL2 PRIVATE SDL2::SDL2-static SDL2_mixer::SDL2_mixer-static)
else()
......
......@@ -41,7 +41,7 @@
#endif
#if defined (_WIN32) && !defined (main)
//#define SDLMAIN
#define SDLMAIN
#endif
#ifdef SDLMAIN
......
......@@ -31,7 +31,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#endif
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST srb2win.exe.manifest
/* CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST srb2win.exe.manifest */
/////////////////////////////////////////////////////////////////////////////
//
......
......@@ -12,5 +12,5 @@ CPMAddPackage(
if(libgme_ADDED)
target_compile_features(gme PRIVATE cxx_std_11)
# libgme's CMakeLists.txt already links this
#target_link_libraries(gme PRIVATE ZLIB::ZLIB)
target_link_libraries(gme PRIVATE ZLIB::ZLIB)
endif()
CPMAddPackage(
NAME SDL2
VERSION 2.24.2
URL "https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.24.2.zip"
EXCLUDE_FROM_ALL ON
OPTIONS
set(
internal_sdl2_options
"BUILD_SHARED_LIBS ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}"
"SDL_SHARED ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}"
"SDL_STATIC ${NOT_SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}"
"SDL_TEST OFF"
"SDL2_DISABLE_SDL2MAIN ON"
"SDL2_DISABLE_INSTALL ON"
)
if(${CMAKE_SYSTEM} MATCHES Windows)
list(APPEND internal_sdl2_options "SDL2_DISABLE_SDL2MAIN OFF")
endif()
if(${CMAKE_SYSTEM} MATCHES Darwin)
list(APPEND internal_sdl2_options "SDL2_DISABLE_SDL2MAIN OFF")
endif()
if(${CMAKE_SYSTEM} MATCHES Linux)
list(APPEND internal_sdl2_options "SDL2_DISABLE_SDL2MAIN ON")
endif()
CPMAddPackage(
NAME SDL2
VERSION 2.24.2
URL "https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.24.2.zip"
EXCLUDE_FROM_ALL ON
OPTIONS ${internal_sdl2_options}
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment