diff --git a/CMakeLists.txt b/CMakeLists.txt index 314854a6278..6b683d828fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -751,7 +751,7 @@ if(CMAKE_STRIP AND NOT DISABLE_STRIP) COMMAND $<$,$>:${CMAKE_STRIP}> ARGS $) - if(TARGET ${DEVIL_PATCHER}) + if(DEVIL_PATCHER) add_custom_command( TARGET ${DEVIL_PATCHER} POST_BUILD DEPENDS ${DEVIL_PATCHER} @@ -766,7 +766,7 @@ get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(is_multi_config) set(CONFIG_PATH $/config.h) target_include_directories(${BIN_TARGET} PRIVATE ${CMAKE_BINARY_DIR}/$) - if(TARGET ${DEVIL_PATCHER}) + if(DEVIL_PATCHER) target_include_directories(${DEVIL_PATCHER} PRIVATE ${CMAKE_BINARY_DIR}/$) endif() else() @@ -944,7 +944,7 @@ endforeach(def_name) target_compile_definitions(${BIN_TARGET} PRIVATE ${def_list}) target_compile_definitions(smacker PRIVATE ${def_list}) -if(TARGET ${DEVIL_PATCHER}) +if(DEVIL_PATCHER) target_compile_definitions(${DEVIL_PATCHER} PRIVATE ${def_list}) endif() @@ -1040,7 +1040,7 @@ endif() if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT GPERF AND NOT HAIKU AND NOT VITA) target_link_libraries(${BIN_TARGET} PUBLIC "$<$>:-static-libgcc;-static-libstdc++>") - if(TARGET ${DEVIL_PATCHER}) + if(DEVIL_PATCHER) target_link_libraries(${DEVIL_PATCHER} PUBLIC "$<$>:-static-libgcc;-static-libstdc++>") endif() endif() @@ -1069,12 +1069,12 @@ if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8)) target_compile_options(${BIN_TARGET} PUBLIC "-fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=") - if(TARGET ${DEVIL_PATCHER}) + if(DEVIL_PATCHER) target_compile_options(${DEVIL_PATCHER} PUBLIC "-fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=") endif() else() get_target_property(devilutionx_SRCS ${BIN_TARGET} SOURCES) - if(TARGET ${DEVIL_PATCHER}) + if(DEVIL_PATCHER) get_target_property(devil_patcher_SRCS ${DEVIL_PATCHER} SOURCES) list(APPEND devilutionx_SRCS ${devil_patcher_SRCS}) endif() @@ -1147,7 +1147,7 @@ if(APPLE) install (TARGETS ${BIN_TARGET} DESTINATION ./) - if(TARGET ${DEVIL_PATCHER}) + if(DEVIL_PATCHER) set_target_properties(${DEVIL_PATCHER} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon.icns") set_target_properties(${DEVIL_PATCHER} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/apple/Info.plist") @@ -1159,7 +1159,7 @@ if(APPLE) include(BundleUtilities) fixup_bundle(\"${CMAKE_BINARY_DIR}/${BIN_TARGET}.app\" \"\" \"\") ") - if(TARGET ${DEVIL_PATCHER}) + if(DEVIL_PATCHER) set(BUNDLE_FIXUP_CODE "${BUNDLE_FIXUP_CODE}fixup_bundle(\"${CMAKE_BINARY_DIR}/${DEVIL_PATCHER}.app\" \"\" \"\") ") endif() @@ -1361,7 +1361,7 @@ if(CPACK) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/devilx.mpq" DESTINATION "." ) - if(TARGET ${DEVIL_PATCHER}) + if(DEVIL_PATCHER) install(TARGETS ${DEVIL_PATCHER} DESTINATION .) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/listfiles.txt" @@ -1462,7 +1462,7 @@ if(CPACK) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/devilx.mpq" DESTINATION "share/diasurgical/${project_name}" ) - if(TARGET ${DEVIL_PATCHER}) + if(DEVIL_PATCHER) install(TARGETS ${DEVIL_PATCHER} DESTINATION bin) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/listfiles.txt" diff --git a/Packaging/OpenDingux/build.sh b/Packaging/OpenDingux/build.sh index 9284830acbd..cb6a553881f 100755 --- a/Packaging/OpenDingux/build.sh +++ b/Packaging/OpenDingux/build.sh @@ -100,7 +100,7 @@ cmake_configure() { "-DTARGET_PLATFORM=$TARGET" \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}/usr/share/buildroot/toolchainfile.cmake" \ - "${CMAKE_ARGS}" \ + ${CMAKE_ARGS} \ "$@" } diff --git a/Source/all.h b/Source/all.h index 69052ad84ff..5b358b1602e 100644 --- a/Source/all.h +++ b/Source/all.h @@ -21,12 +21,8 @@ #include -#ifdef USE_SDL1 #include "utils/sdl2_to_1_2_backports.h" -#else #include "utils/sdl2_backports.h" -#endif - #include "utils/sdl_compat.h" #include "utils/log.h" diff --git a/Source/utils/sdl2_backports.h b/Source/utils/sdl2_backports.h index 3280f4713eb..c766676851f 100644 --- a/Source/utils/sdl2_backports.h +++ b/Source/utils/sdl2_backports.h @@ -1,6 +1,6 @@ #pragma once // Backports for older versions of SDL 2. - +#ifndef USE_SDL1 #include #if !SDL_VERSION_ATLEAST(2, 0, 4) @@ -45,3 +45,4 @@ SDL_CreateRGBSurfaceWithFormatFrom(void* pixels, return surface; } #endif +#endif // !USE_SDL1 \ No newline at end of file diff --git a/tools/patcher/all.h b/tools/patcher/all.h index b01c9ae0704..3752597db92 100644 --- a/tools/patcher/all.h +++ b/tools/patcher/all.h @@ -20,12 +20,8 @@ #include -#ifdef USE_SDL1 #include "utils/sdl2_to_1_2_backports.h" -#else #include "utils/sdl2_backports.h" -#endif - #include "utils/sdl_compat.h" #include "utils/log.h" diff --git a/tools/patcher/utils/sdl2_backports.h b/tools/patcher/utils/sdl2_backports.h index 3280f4713eb..c766676851f 100644 --- a/tools/patcher/utils/sdl2_backports.h +++ b/tools/patcher/utils/sdl2_backports.h @@ -1,6 +1,6 @@ #pragma once // Backports for older versions of SDL 2. - +#ifndef USE_SDL1 #include #if !SDL_VERSION_ATLEAST(2, 0, 4) @@ -45,3 +45,4 @@ SDL_CreateRGBSurfaceWithFormatFrom(void* pixels, return surface; } #endif +#endif // !USE_SDL1 \ No newline at end of file