From a449fa4a1d1337057e1ae4c305c623997301ddd8 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 6 Jun 2020 22:05:25 -0400 Subject: [PATCH 1/9] Added SDL Mixer X to CMAKE (Windows only) --- src/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ src/sdl/CMakeLists.txt | 23 +++++++++++++++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b0a593bb1..840feb3fa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -226,6 +226,12 @@ set(SRB2_CONFIG_HAVE_GME ON CACHE BOOL "Enable GME support.") set(SRB2_CONFIG_HAVE_OPENMPT ON CACHE BOOL "Enable OpenMPT support.") +if(${CMAKE_SYSTEM} MATCHES Windows) + set(SRB2_CONFIG_HAVE_MIXERX ON CACHE BOOL + "Enable SDL Mixer X support.") +else() + set(SRB2_CONFIG_HAVE_MIXERX OFF) +endif() set(SRB2_CONFIG_HWRENDER ON CACHE BOOL "Enable hardware rendering through OpenGL.") set(SRB2_CONFIG_USEASM OFF CACHE BOOL @@ -366,6 +372,30 @@ if(${SRB2_CONFIG_HAVE_OPENMPT}) endif() endif() +if(${SRB2_CONFIG_HAVE_MIXERX}) + if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) + set(MIXERX_FOUND ON) + set(MIXERX_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/include/SDL2) + if(${SRB2_SYSTEM_BITS} EQUAL 64) + set(MIXERX_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDLMixerX/x86_64-w64-mingw32/lib -lSDL2_mixer_ext") + else() # 32-bit + set(MIXERX_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/lib -lSDL2_mixer_ext") + endif() + else() + # No support for non-Windows (yet?) + #find_package(MIXERX) + message(WARNING "SDL Mixer X is not supported as an external library.") + set(MIXERX_FOUND OFF) + endif() + if(${MIXERX_FOUND}) + set(SRB2_HAVE_MIXERX ON) + set(SRB2_SDL2_SOUNDIMPL mixer_sound.c) + add_definitions(-DHAVE_MIXERX) + else() + message(WARNING "You have specified that SDL Mixer X is available but it was not found.") + endif() +endif() + if(${SRB2_CONFIG_HAVE_ZLIB}) if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) set(ZLIB_FOUND ON) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 38d557a3f..d5a5fc950 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -1,6 +1,10 @@ # Declare SDL2 interface sources -set(SRB2_CONFIG_SDL2_USEMIXER ON CACHE BOOL "Use SDL2_mixer or regular sdl sound") +if(NOT ${SRB2_CONFIG_HAVE_MIXERX}) + set(SRB2_CONFIG_SDL2_USEMIXER ON CACHE BOOL "Use SDL2_mixer or regular sdl sound") +else() + set(SRB2_CONFIG_SDL2_USEMIXER OFF) +endif() if(${SRB2_CONFIG_SDL2_USEMIXER}) if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}) @@ -22,6 +26,8 @@ if(${SRB2_CONFIG_SDL2_USEMIXER}) message(WARNING "You specified that SDL2_mixer is available, but it was not found. Falling back to sdl sound.") set(SRB2_SDL2_SOUNDIMPL sdl_sound.c) endif() +elseif(${MIXERX_FOUND}) + set(SRB2_SDL2_SOUNDIMPL mixer_sound.c) else() set(SRB2_SDL2_SOUNDIMPL sdl_sound.c) endif() @@ -156,6 +162,7 @@ if(${SDL2_FOUND}) SDL2_mixer ${GME_LIBRARIES} ${OPENMPT_LIBRARIES} + ${MIXERX_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENGL_LIBRARIES} @@ -167,6 +174,7 @@ if(${SDL2_FOUND}) ${SDL2_MIXER_LIBRARIES} ${GME_LIBRARIES} ${OPENMPT_LIBRARIES} + ${MIXERX_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENGL_LIBRARIES} @@ -247,12 +255,13 @@ if(${SDL2_FOUND}) ${SDL2_MIXER_INCLUDE_DIRS} ${GME_INCLUDE_DIRS} ${OPENMPT_INCLUDE_DIRS} + ${MIXERX_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS} ) - if(${SRB2_HAVE_MIXER}) + if((${SRB2_HAVE_MIXER}) OR (${SRB2_HAVE_MIXERX})) target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXER -DSOUND=SOUND_MIXER) endif() @@ -294,6 +303,7 @@ if(${SDL2_FOUND}) HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/bin HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/x86_64-w64-mingw32/bin HINTS ${CMAKE_SOURCE_DIR}/libs/libopenmpt/bin/x86_64/mingw + HINTS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/x86_64-w64-mingw32/bin ) else() find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}" @@ -301,6 +311,7 @@ if(${SDL2_FOUND}) HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/bin HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/i686-w64-mingw32/bin HINTS ${CMAKE_SOURCE_DIR}/libs/libopenmpt/bin/x86/mingw + HINTS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/bin ) endif() else() @@ -310,6 +321,7 @@ if(${SDL2_FOUND}) HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/lib/x64 HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/lib/x64 HINTS ${CMAKE_SOURCE_DIR}/libs/libopenmpt/bin/x86_64/mingw + HINTS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/x86_64-w64-mingw32/bin ) else() find_library(SRB2_SDL2_DLL_${dllname} "${defaultname}" @@ -317,6 +329,7 @@ if(${SDL2_FOUND}) HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2/lib/x86 HINTS ${CMAKE_SOURCE_DIR}/libs/SDL2_mixer/lib/x86 HINTS ${CMAKE_SOURCE_DIR}/libs/libopenmpt/bin/x86/mingw + HINTS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/bin ) endif() endif() @@ -340,6 +353,12 @@ if(${SDL2_FOUND}) if(${SRB2_CONFIG_HAVE_OPENMPT}) getwinlib(libopenmpt "libopenmpt.dll") endif() + if(${SRB2_CONFIG_HAVE_MIXERX}) + getwinlib(SDL2_mixer_ext "SDL2_mixer_ext.dll") + getwinlib(libfluidsynth-2 "libfluidsynth-2.dll") + getwinlib(libgcc_s_sjlj-1 "libgcc_s_sjlj-1.dll") + getwinlib(libstdc++-6 "libstdc++-6.dll") + endif() install(PROGRAMS ${win_extra_dll_list} From ded6285249bd994ee88a9b77cd88ec5f649525f9 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 7 Jun 2020 18:35:33 -0400 Subject: [PATCH 2/9] CMAKE improvements: optional asset install; exe.debug for RelWithDebInfo --- CMakeLists.txt | 1 + assets/CMakeLists.txt | 32 +++++++++++++++++++++----------- src/sdl/CMakeLists.txt | 20 +++++++++++++++----- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e46f5dc3..480baa7ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,4 +131,5 @@ set(CPACK_PACKAGE_VERSION_MAJOR ${SRB2_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${SRB2_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${SRB2_VERSION_PATCH}) set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}") +SET(CPACK_OUTPUT_FILE_PREFIX package) include(CPack) diff --git a/assets/CMakeLists.txt b/assets/CMakeLists.txt index 095349418..3ea7c28df 100644 --- a/assets/CMakeLists.txt +++ b/assets/CMakeLists.txt @@ -12,6 +12,9 @@ ENDFUNCTION(PREPEND) set(SRB2_ASSET_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/installer" CACHE STRING "Path to directory that contains all asset files for the installer.") +set(SRB2_ASSET_INSTALL ON + CACHE BOOL "Insert asset files into the install directory or package.") + #################### # POST-V2.2 NOTE: Do not forget to add patch.pk3 to the end of this list! #################### @@ -43,20 +46,27 @@ endforeach() if(${CMAKE_SYSTEM} MATCHES Darwin) get_target_property(outname SRB2SDL2 OUTPUT_NAME) - install(DIRECTORY "${SRB2_ASSET_DIRECTORY}/" - DESTINATION "${outname}.app/Contents/Resources" - ) + if(${SRB2_ASSET_INSTALL}) + install(DIRECTORY "${SRB2_ASSET_DIRECTORY}/" + DESTINATION "${outname}.app/Contents/Resources" + ) + endif() + # Always install the doc files, even in non-asset packages. install(FILES ${SRB2_ASSET_DOCS} DESTINATION . OPTIONAL ) else() - install(DIRECTORY "${SRB2_ASSET_DIRECTORY}/" - DESTINATION . - ) - # Docs are assumed to be located in SRB2_ASSET_DIRECTORY, so don't install again - #install(FILES ${SRB2_ASSET_DOCS} - # DESTINATION . - # OPTIONAL - #) + if(${SRB2_ASSET_INSTALL}) + install(DIRECTORY "${SRB2_ASSET_DIRECTORY}/" + DESTINATION . + ) + # Docs are assumed to be located in SRB2_ASSET_DIRECTORY, so don't install them in their own call. + else() + # Always install the doc files, even in non-asset packages. + install(FILES ${SRB2_ASSET_DOCS} + DESTINATION . + OPTIONAL + ) + endif() endif() diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index d5a5fc950..1e3d0f7a6 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -269,14 +269,18 @@ if(${SDL2_FOUND}) -DHAVE_SDL ) - ## strip debug symbols into separate file when using gcc - if(CMAKE_COMPILER_IS_GNUCC) - if(${CMAKE_BUILD_TYPE} MATCHES Debug) + ## strip debug symbols into separate file when using gcc. + ## to be consistent with Makefile, don't generate for OS X. + if((CMAKE_COMPILER_IS_GNUCC) AND NOT (${CMAKE_SYSTEM} MATCHES Darwin)) + if((${CMAKE_BUILD_TYPE} MATCHES Debug) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)) + if(${CMAKE_BUILD_TYPE} MATCHES Debug) + set(OBJCOPY_ONLY_KEEP_DEBUG "--only-keep-debug") + endif() message(STATUS "Will make separate debug symbols in *.debug") add_custom_command(TARGET SRB2SDL2 POST_BUILD - COMMAND ${OBJCOPY} --only-keep-debug $ $.debug + COMMAND ${OBJCOPY} ${OBJCOPY_ONLY_KEEP_DEBUG} $ $.debug COMMAND ${OBJCOPY} --strip-debug $ - COMMAND ${OBJCOPY} --add-gnu-debuglink=$.debug $ + COMMAND ${OBJCOPY} --add-gnu-debuglink=$.debug $ ) endif() endif() @@ -290,6 +294,12 @@ if(${SDL2_FOUND}) install(TARGETS SRB2SDL2 SRB2SDL2 RUNTIME DESTINATION . ) + if ((${CMAKE_BUILD_TYPE} MATCHES Debug) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)) + install(FILES $.debug + DESTINATION . + OPTIONAL + ) + endif() endif() if(${CMAKE_SYSTEM} MATCHES Windows) From c63ead5abb4afd9b55edf18c75a78757404c30d9 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 7 Jun 2020 20:27:18 -0400 Subject: [PATCH 3/9] CMAKE: Configurable CPACK generator --- CMakeLists.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 480baa7ef..dc92de90c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,16 +113,19 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINAR ##### PACKAGE CONFIGURATION ##### -if(${CMAKE_SYSTEM} MATCHES "Windows") - set(CPACK_GENERATOR "ZIP") -endif() -if(${CMAKE_SYSTEM} MATCHES "Linux") - set(CPACK_GENERATOR "TGZ") -endif() -if(${CMAKE_SYSTEM} MATCHES "Darwin") - set(CPACK_GENERATOR "DragNDrop") +set(SRB2_CPACK_GENERATOR "" CACHE STRING "Generator to use for making a package. E.g., ZIP, TGZ, DragNDrop (OSX only). Leave blank for default generator.") + +if("${SRB2_CPACK_GENERATOR}" STREQUAL "") + if(${CMAKE_SYSTEM} MATCHES "Windows") + set(SRB2_CPACK_GENERATOR "ZIP") + elseif(${CMAKE_SYSTEM} MATCHES "Linux") + set(SRB2_CPACK_GENERATOR "TGZ") + elseif(${CMAKE_SYSTEM} MATCHES "Darwin") + set(SRB2_CPACK_GENERATOR "TGZ") + endif() endif() +set(CPACK_GENERATOR ${SRB2_CPACK_GENERATOR}) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Sonic Robo Blast 2" CACHE STRING "Program name for display purposes") set(CPACK_PACKAGE_VENDOR "Sonic Team Jr." CACHE STRING "Vendor name for display purposes") #set(CPACK_PACKAGE_DESCRIPTION_FILE ) From aef9a1b522ebdad2a2c1b977389091e136c60e05 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 7 Jun 2020 20:41:43 -0400 Subject: [PATCH 4/9] CMAKE: Add CCACHE support --- CMakeLists.txt | 17 +++++++++++++++++ launch-c.in | 3 +++ launch-cxx.in | 3 +++ src/CMakeLists.txt | 21 +++++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 launch-c.in create mode 100644 launch-cxx.in diff --git a/CMakeLists.txt b/CMakeLists.txt index dc92de90c..495da101e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,17 @@ cmake_minimum_required(VERSION 3.0) + +# Enable CCache early +set(SRB2_USE_CCACHE OFF CACHE BOOL "Use CCache") +if (${SRB2_USE_CCACHE}) + find_program(CCACHE_PROGRAM ccache) + if(CCACHE_PROGRAM) + message(STATUS "Found CCache: ${CCACHE_PROGRAM}") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") + else() + message(WARNING "You have specified to use CCACHE but it was not found. Object files will not be cached.") + endif() +endif() + # DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string. # Version change is fine. project(SRB2 @@ -9,6 +22,10 @@ if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) message(FATAL_ERROR "In-source builds will bring you a world of pain. Please make a separate directory to invoke CMake from.") endif() +if ((${SRB2_USE_CCACHE}) AND (${CMAKE_C_COMPILER} MATCHES "clang")) + message(WARNING "Using clang and CCache: You may want to set environment variable CCACHE_CPP2=yes to prevent include errors during compile.") +endif() + # Set up CMAKE path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") diff --git a/launch-c.in b/launch-c.in new file mode 100644 index 000000000..c60558232 --- /dev/null +++ b/launch-c.in @@ -0,0 +1,3 @@ +#!/bin/sh +export CCACHE_CPP2=true +exec "${RULE_LAUNCH_COMPILE}" "${CMAKE_C_COMPILER}" "$@" diff --git a/launch-cxx.in b/launch-cxx.in new file mode 100644 index 000000000..c60558232 --- /dev/null +++ b/launch-cxx.in @@ -0,0 +1,3 @@ +#!/bin/sh +export CCACHE_CPP2=true +exec "${RULE_LAUNCH_COMPILE}" "${CMAKE_C_COMPILER}" "$@" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 840feb3fa..fda3f2e7e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -523,6 +523,27 @@ endif() # Targets +# If using CCACHE, then force it. +# https://github.com/Cockatrice/Cockatrice/pull/3052/files +if (${CMAKE_SYSTEM} MATCHES "Darwin") + get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE) + if(RULE_LAUNCH_COMPILE) + MESSAGE(STATUS "Force enabling CCache usage under macOS") + # Set up wrapper scripts + configure_file(${CMAKE_MODULE_PATH}/launch-c.in launch-c) + configure_file(${CMAKE_MODULE_PATH}/launch-cxx.in launch-cxx) + execute_process(COMMAND chmod a+rx + "${CMAKE_BINARY_DIR}/launch-c" + "${CMAKE_BINARY_DIR}/launch-cxx") + + # Set Xcode project attributes to route compilation through our scripts + set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c") + set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/launch-cxx") + set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c") + set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx") + endif() +endif() + # Compatibility flag with later versions of GCC # We should really fix our code to not need this if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") From efba50c83c73ac770851c2c12b1a26e0df6f8511 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 7 Jun 2020 23:57:15 -0400 Subject: [PATCH 5/9] CMAKE: Add SRB2_DEBUG_INSTALL to toggle *.debug in install/package --- src/sdl/CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 1e3d0f7a6..481f1a426 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -295,10 +295,13 @@ if(${SDL2_FOUND}) RUNTIME DESTINATION . ) if ((${CMAKE_BUILD_TYPE} MATCHES Debug) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo)) - install(FILES $.debug - DESTINATION . - OPTIONAL - ) + set(SRB2_DEBUG_INSTALL OFF CACHE BOOL "Insert *.debug file into the install directory or package.") + if (${SRB2_DEBUG_INSTALL}) + install(FILES $.debug + DESTINATION . + OPTIONAL + ) + endif() endif() endif() From f3c1db06509323aa212fbc36fe0449f27fed16ab Mon Sep 17 00:00:00 2001 From: mazmazz Date: Mon, 8 Jun 2020 03:08:58 -0400 Subject: [PATCH 6/9] CMAKE: Fix OSX CCache error --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fda3f2e7e..86adcb5e5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -530,8 +530,8 @@ if (${CMAKE_SYSTEM} MATCHES "Darwin") if(RULE_LAUNCH_COMPILE) MESSAGE(STATUS "Force enabling CCache usage under macOS") # Set up wrapper scripts - configure_file(${CMAKE_MODULE_PATH}/launch-c.in launch-c) - configure_file(${CMAKE_MODULE_PATH}/launch-cxx.in launch-cxx) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../launch-c.in launch-c) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../launch-cxx.in launch-cxx) execute_process(COMMAND chmod a+rx "${CMAKE_BINARY_DIR}/launch-c" "${CMAKE_BINARY_DIR}/launch-cxx") From 36e17006b7bf769d6b3a23015e13b34ead1fa386 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 9 Jun 2020 11:11:40 -0400 Subject: [PATCH 7/9] CMAKE: Fix OS X ccache scripts --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 86adcb5e5..1da86d0ae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -530,8 +530,8 @@ if (${CMAKE_SYSTEM} MATCHES "Darwin") if(RULE_LAUNCH_COMPILE) MESSAGE(STATUS "Force enabling CCache usage under macOS") # Set up wrapper scripts - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../launch-c.in launch-c) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../launch-cxx.in launch-cxx) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../launch-c.in ${CMAKE_BINARY_DIR}/launch-c) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../launch-cxx.in ${CMAKE_BINARY_DIR}/launch-cxx) execute_process(COMMAND chmod a+rx "${CMAKE_BINARY_DIR}/launch-c" "${CMAKE_BINARY_DIR}/launch-cxx") From 46b383acda4e4e5b04afb8f1315800b837a5bc9f Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 9 Jun 2020 17:31:49 -0400 Subject: [PATCH 8/9] CMAKE: Fix toggle fullscreen breakage due to missing define This is lazy. The correct solution is to eliminate the define in the program code --- src/sdl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 481f1a426..744b242fa 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -266,7 +266,7 @@ if(${SDL2_FOUND}) endif() target_compile_definitions(SRB2SDL2 PRIVATE - -DHAVE_SDL + -DDDIRECTFULLSCREEN -DHAVE_SDL ) ## strip debug symbols into separate file when using gcc. From 8fc414536f5923e9f7f36cb2ab3e485fee0307d0 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 10 Jun 2020 15:07:41 -0400 Subject: [PATCH 9/9] CMAKE: Move launch-c into more sensible location --- launch-c.in => cmake/launch-c.in | 0 launch-cxx.in => cmake/launch-cxx.in | 0 src/CMakeLists.txt | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename launch-c.in => cmake/launch-c.in (100%) rename launch-cxx.in => cmake/launch-cxx.in (100%) diff --git a/launch-c.in b/cmake/launch-c.in similarity index 100% rename from launch-c.in rename to cmake/launch-c.in diff --git a/launch-cxx.in b/cmake/launch-cxx.in similarity index 100% rename from launch-cxx.in rename to cmake/launch-cxx.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1da86d0ae..16063fe2e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -530,8 +530,8 @@ if (${CMAKE_SYSTEM} MATCHES "Darwin") if(RULE_LAUNCH_COMPILE) MESSAGE(STATUS "Force enabling CCache usage under macOS") # Set up wrapper scripts - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../launch-c.in ${CMAKE_BINARY_DIR}/launch-c) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../launch-cxx.in ${CMAKE_BINARY_DIR}/launch-cxx) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/launch-c.in ${CMAKE_BINARY_DIR}/launch-c) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/launch-cxx.in ${CMAKE_BINARY_DIR}/launch-cxx) execute_process(COMMAND chmod a+rx "${CMAKE_BINARY_DIR}/launch-c" "${CMAKE_BINARY_DIR}/launch-cxx")