nix: adapt cmake options

This commit is contained in:
diniamo 2024-09-13 17:29:41 +02:00 committed by Mihai Fufezan
parent d505b33665
commit c35ed8363f
3 changed files with 7 additions and 36 deletions

View file

@ -1,10 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6fdf98db..d8424d91 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.30)
+cmake_minimum_required(VERSION 3.27)
# Get version
file(READ "${CMAKE_SOURCE_DIR}/VERSION" VER_RAW)

View file

@ -62,13 +62,6 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
src = lib.cleanSource ../.; src = lib.cleanSource ../.;
}; };
patches = [
# forces GCC to use -std=c++26
./stdcxx.patch
# Nix does not have CMake 3.30 yet, so override the minimum version
./cmake-version.patch
];
postPatch = '' postPatch = ''
# Fix hardcoded paths to /usr installation # Fix hardcoded paths to /usr installation
sed -i "s#/usr#$out#" src/render/OpenGL.cpp sed -i "s#/usr#$out#" src/render/OpenGL.cpp
@ -144,18 +137,18 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
(lib.optionals withSystemd [systemd]) (lib.optionals withSystemd [systemd])
]; ];
cmakeBuildType = mesonBuildType =
if debug if debug
then "Debug" then "debug"
else "RelWithDebInfo"; else "release";
# we want as much debug info as possible # we want as much debug info as possible
dontStrip = debug; dontStrip = debug;
cmakeFlags = [ mesonFlags = [
(lib.cmakeBool "NO_XWAYLAND" (!enableXWayland)) (lib.mesonEnable "xwayland" enableXWayland)
(lib.cmakeBool "LEGACY_RENDERER" legacyRenderer) (lib.mesonEnable "legacy_renderer" legacyRenderer)
(lib.cmakeBool "NO_SYSTEMD" (!withSystemd)) (lib.mesonEnable "systemd" withSystemd)
]; ];
postInstall = '' postInstall = ''

View file

@ -1,12 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cfbd431f..73e8e0c2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,6 +64,7 @@ endif()
include_directories(. "src/" "subprojects/udis86/" "protocols/")
set(CMAKE_CXX_STANDARD 26)
add_compile_options(
+ -std=c++26
-Wall
-Wextra
-Wno-unused-parameter