Skip to content

Commit

Permalink
supercell-wx: update for gcc14 and use Nix stb
Browse files Browse the repository at this point in the history
  • Loading branch information
aware70 committed Jan 2, 2025
1 parent e3fa685 commit 153f063
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
4 changes: 3 additions & 1 deletion pkgs/by-name/su/supercell-wx/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ stdenv.mkDerivation (finalAttrs: {
maintainers = with lib.maintainers; [ aware70 ];
};

env.CXXFLAGS = "-Wno-error=restrict -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations";
env.CXXFLAGS = "-Wno-error=restrict -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=stringop-overflow";
env.GTEST_FILTER = "-${lib.concatStringsSep ":" gtestSkip}";

doCheck = true;

# These tests aren't built by 'all', but ctest still tries to run them.
cmakeFlags = [
"-DCMAKE_CTEST_ARGUMENTS=-E;'test_mln_core|test_mln_widgets'"
"-DSTB_INCLUDE_DIR=${stb}/include/stb"
];

patches = [
Expand All @@ -106,6 +107,7 @@ stdenv.mkDerivation (finalAttrs: {
url = "https://github.com/dpaulat/supercell-wx/commit/9dfbac66172b882c5c4ccfa4251a03f8bf607b02.diff";
sha256 = "sha256-sGw/vwJVNcWD56z/cG0VMZo+daQXb/I0+zbG3Gr18lU=";
})
./patches/add-missing-algorithm-include-gcc14.patch
# }}}
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/test/source/scwx/common/products.test.cpp b/test/source/scwx/common/products.test.cpp
index 5b945bf3..2657074e 100644
--- a/test/source/scwx/common/products.test.cpp
+++ b/test/source/scwx/common/products.test.cpp
@@ -1,5 +1,6 @@
#include <scwx/common/products.hpp>

+#include <algorithm>
#include <gtest/gtest.h>

namespace scwx
19 changes: 15 additions & 4 deletions pkgs/by-name/su/supercell-wx/patches/use-find-package.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08b5e82..0063794 100644
index 08b5e823..00637941 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,32 +15,6 @@ enable_testing()
Expand Down Expand Up @@ -36,7 +36,7 @@ index 08b5e82..0063794 100644

set(SCWX_DIR ${PROJECT_SOURCE_DIR})
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index bbc76c6..e242ee4 100644
index bbc76c64..e242ee44 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -13,8 +13,8 @@ set_property(DIRECTORY
Expand All @@ -50,8 +50,19 @@ index bbc76c6..e242ee4 100644
include(hsluv-c.cmake)
include(imgui.cmake)
include(maplibre-native-qt.cmake)
diff --git a/external/stb.cmake b/external/stb.cmake
index c26bedaf..cd978e9d 100644
--- a/external/stb.cmake
+++ b/external/stb.cmake
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.20)
set(PROJECT_NAME scwx-stb)

-set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stb PARENT_SCOPE)
+# Nix: specify with cmakeFlags
+#set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stb PARENT_SCOPE)
diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake
index cda6c7f..008f4c4 100644
index cda6c7f2..008f4c4a 100644
--- a/scwx-qt/scwx-qt.cmake
+++ b/scwx-qt/scwx-qt.cmake
@@ -11,14 +11,15 @@ set(CMAKE_AUTORCC ON)
Expand Down Expand Up @@ -100,7 +111,7 @@ index cda6c7f..008f4c4 100644

target_link_libraries(supercell-wx PRIVATE scwx-qt
diff --git a/wxdata/wxdata.cmake b/wxdata/wxdata.cmake
index 0ce08cb..3807810 100644
index 0ce08cbb..3807810d 100644
--- a/wxdata/wxdata.cmake
+++ b/wxdata/wxdata.cmake
@@ -2,11 +2,14 @@ cmake_minimum_required(VERSION 3.20)
Expand Down

0 comments on commit 153f063

Please sign in to comment.