mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-02 05:01:56 -07:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
48f2f490d0 | ||
|
94c7996b87 | ||
|
674e7df000 | ||
|
cb7f9140da |
@@ -216,10 +216,13 @@ set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
|||||||
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
|
||||||
message(STATUS "Setting precompiled headers")
|
if(CMAKE_DISABLE_PRECOMPILE_HEADERS)
|
||||||
|
message(STATUS "Not using precompiled headers")
|
||||||
target_precompile_headers(Hyprland PRIVATE
|
else()
|
||||||
|
message(STATUS "Setting precompiled headers")
|
||||||
|
target_precompile_headers(Hyprland PRIVATE
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:src/pch/pch.hpp>)
|
$<$<COMPILE_LANGUAGE:CXX>:src/pch/pch.hpp>)
|
||||||
|
endif()
|
||||||
|
|
||||||
message(STATUS "Setting link libraries")
|
message(STATUS "Setting link libraries")
|
||||||
|
|
||||||
|
10
nix/cmake-version.patch
Normal file
10
nix/cmake-version.patch
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
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)
|
@@ -5,9 +5,7 @@
|
|||||||
pkg-config,
|
pkg-config,
|
||||||
pkgconf,
|
pkgconf,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
meson,
|
|
||||||
cmake,
|
cmake,
|
||||||
ninja,
|
|
||||||
aquamarine,
|
aquamarine,
|
||||||
binutils,
|
binutils,
|
||||||
cairo,
|
cairo,
|
||||||
@@ -53,7 +51,7 @@
|
|||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
inherit (lib.lists) flatten concatLists optional optionals;
|
inherit (lib.lists) flatten concatLists optional optionals;
|
||||||
inherit (lib.sources) cleanSourceWith cleanSource;
|
inherit (lib.sources) cleanSourceWith cleanSource;
|
||||||
inherit (lib.strings) hasSuffix makeBinPath optionalString mesonBool mesonEnable;
|
inherit (lib.strings) cmakeBool hasSuffix makeBinPath optionalString;
|
||||||
|
|
||||||
adapters = flatten [
|
adapters = flatten [
|
||||||
stdenvAdapters.useMoldLinker
|
stdenvAdapters.useMoldLinker
|
||||||
@@ -76,6 +74,14 @@ in
|
|||||||
src = cleanSource ../.;
|
src = 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
|
||||||
@@ -97,9 +103,7 @@ in
|
|||||||
hyprwayland-scanner
|
hyprwayland-scanner
|
||||||
jq
|
jq
|
||||||
makeWrapper
|
makeWrapper
|
||||||
meson
|
|
||||||
cmake
|
cmake
|
||||||
ninja
|
|
||||||
pkg-config
|
pkg-config
|
||||||
python3 # for udis86
|
python3 # for udis86
|
||||||
wayland-scanner
|
wayland-scanner
|
||||||
@@ -144,22 +148,20 @@ in
|
|||||||
(optional withSystemd systemd)
|
(optional withSystemd systemd)
|
||||||
];
|
];
|
||||||
|
|
||||||
mesonBuildType =
|
cmakeBuildType =
|
||||||
if debug
|
if debug
|
||||||
then "debug"
|
then "Debug"
|
||||||
else "release";
|
else "RelWithDebInfo";
|
||||||
|
|
||||||
# we want as much debug info as possible
|
# we want as much debug info as possible
|
||||||
dontStrip = debug;
|
dontStrip = debug;
|
||||||
|
|
||||||
mesonFlags = flatten [
|
cmakeFlags = mapAttrsToList cmakeBool {
|
||||||
(mapAttrsToList mesonEnable {
|
"NO_XWAYLAND" = !enableXWayland;
|
||||||
"xwayland" = enableXWayland;
|
"LEGACY_RENDERER" = legacyRenderer;
|
||||||
"legacy_renderer" = legacyRenderer;
|
"NO_SYSTEMD" = !withSystemd;
|
||||||
"systemd" = withSystemd;
|
"CMAKE_DISABLE_PRECOMPILE_HEADERS" = true;
|
||||||
})
|
};
|
||||||
(mesonBool "b_pch" false)
|
|
||||||
];
|
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
${optionalString wrapRuntimeDeps ''
|
${optionalString wrapRuntimeDeps ''
|
||||||
|
12
nix/stdcxx.patch
Normal file
12
nix/stdcxx.patch
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
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
|
Reference in New Issue
Block a user