From 23c85f926e1fe808b55f0a285f09db1cb6cdcd3d Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Fri, 13 Oct 2023 06:21:51 +0200 Subject: [PATCH] Fix none Windows compilation --- ScreenPlayWallpaper/CMakeLists.txt | 6 ++-- ScreenPlayWallpaper/Godot/CMakeLists.txt | 36 ++----------------- .../GDExtention/src/RegisterExtension.cpp | 2 +- .../src/ScreenPlayGodotWallpaper.cpp | 2 +- .../src/ScreenPlayGodotWallpaper.h | 3 +- 5 files changed, 10 insertions(+), 39 deletions(-) diff --git a/ScreenPlayWallpaper/CMakeLists.txt b/ScreenPlayWallpaper/CMakeLists.txt index 9eee4b15..e48dd820 100644 --- a/ScreenPlayWallpaper/CMakeLists.txt +++ b/ScreenPlayWallpaper/CMakeLists.txt @@ -20,8 +20,8 @@ find_package( Positioning) if(WIN32) - set(SOURCES src/windowsdesktopproperties.cpp src/winwindow.cpp) - set(HEADER src/windowsdesktopproperties.h src/winwindow.h) + set(SOURCES src/windowsdesktopproperties.cpp src/winwindow.cpp src/windowshook.cpp) + set(HEADER src/windowsdesktopproperties.h src/winwindow.h src/windowshook.h) elseif(APPLE) set(SOURCES src/macintegration.cpp src/macwindow.cpp) set(HEADER @@ -52,7 +52,7 @@ set(RESOURCES dot.png qtquickcontrols2.conf index.html) set(LIB_SOURCES ${SOURCES} src/basewindow.cpp) set(LIB_HEADER ${HEADER} src/basewindow.h) -add_library(ScreenPlayWallpaperLib STATIC src/windowshook.cpp src/windowshook.h) +add_library(ScreenPlayWallpaperLib STATIC) target_include_directories(ScreenPlayWallpaperLib PUBLIC src) if(WIN32) diff --git a/ScreenPlayWallpaper/Godot/CMakeLists.txt b/ScreenPlayWallpaper/Godot/CMakeLists.txt index 8cc9b540..996b9450 100644 --- a/ScreenPlayWallpaper/Godot/CMakeLists.txt +++ b/ScreenPlayWallpaper/Godot/CMakeLists.txt @@ -1,35 +1,5 @@ # SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only -add_subdirectory(GDExtention) - -# Disable for ci because it uses separate build step. -# if(NOT ${GITLAB_CI} AND ${GODOT_WALLPAPER}) -# # Normally I would directly call the Godot executable here but after hours of failure without any error messages, lets just call the -# # python script that we want to have anyway... -# find_package(Python COMPONENTS Interpreter) - -# message(STATUS "GODOT_WORKING_DIRECTORY = ${CMAKE_SOURCE_DIR}/Tools") -# message(STATUS "Generate Godot export:") -# message(STATUS "cd ${CMAKE_SOURCE_DIR}/Tools") -# message(STATUS "python build_godot.py --skip_if_exists --build_path '${CMAKE_RUNTIME_OUTPUT_DIRECTORY}'") - -# execute_process( -# COMMAND ${Python_EXECUTABLE} build_godot.py --skip_if_exists --build_path "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" -# WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/Tools" -# TIMEOUT 30 -# RESULT_VARIABLE GODOT_EXPORT_RESULT -# OUTPUT_VARIABLE GODOT_EXPORT_OUTPUT ENCODING UTF8) - -# if(GODOT_EXPORT_RESULT EQUAL "1") -# message(STATUS "Godot export skipped because it already exists.") -# elseif( -# NOT -# GODOT_EXPORT_RESULT -# EQUAL -# "0") -# message(STATUS "################################################") -# message(STATUS "Unable to export Map. Please run Tools/setup.py!") -# message(STATUS "################################################") -# message(FATAL_ERROR "ERROR: ${GODOT_EXPORT_OUTPUT}") -# endif() -# endif() +if(WIN32) + add_subdirectory(GDExtention) +endif() \ No newline at end of file diff --git a/ScreenPlayWallpaper/Godot/GDExtention/src/RegisterExtension.cpp b/ScreenPlayWallpaper/Godot/GDExtention/src/RegisterExtension.cpp index ad9e80f4..ac95cde5 100644 --- a/ScreenPlayWallpaper/Godot/GDExtention/src/RegisterExtension.cpp +++ b/ScreenPlayWallpaper/Godot/GDExtention/src/RegisterExtension.cpp @@ -1,4 +1,4 @@ -// Copied from godot-cpp/test/src and modified. +// SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only #include "gdextension_interface.h" diff --git a/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.cpp b/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.cpp index c98566b6..32369628 100644 --- a/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.cpp +++ b/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.cpp @@ -1,4 +1,4 @@ -// Copied from godot-cpp/test/src and modified. +// SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only #include "ScreenPlayGodotWallpaper.h" #include "godot_cpp/classes/display_server.hpp" diff --git a/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.h b/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.h index 3d96c883..916a6ad6 100644 --- a/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.h +++ b/ScreenPlayWallpaper/Godot/GDExtention/src/ScreenPlayGodotWallpaper.h @@ -1,5 +1,6 @@ +// SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only + #pragma once -// Copied from godot-cpp/test/src and modified. #include "godot_cpp/classes/control.hpp" #include "godot_cpp/classes/global_constants.hpp"