Repro:
main.cpp
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibMain/Main.h>
ErrorOr<int> serenity_main(Main::Arguments)
{
auto theme = GUI::ConnectionToWindowServer::the().get_system_theme();
dbgln("Theme: {}", theme);
return 0;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(Example)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(SOURCES
main.cpp
)
add_executable(Example ${SOURCES})
target_link_libraries(Example gui main)
Then run:
mkdir -p Build
cd Build
cmake .. -GNinja -DCMAKE_TOOLCHAIN_FILE="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}/CMakeToolchain.txt"
ninja
Error:
[1/2] Building CXX object CMakeFiles/Example.dir/main.cpp.o
FAILED: CMakeFiles/Example.dir/main.cpp.o
/home/linus/Dev/serenity/Toolchain/Local/x86_64/bin/x86_64-pc-serenity-g++ --sysroot=/home/linus/Dev/serenity/Build/superbuild-x86_64/../x86_64/Root -std=c++20 -MD -MT CMakeFiles/Example.dir/main.cpp.o -MF CMakeFiles/Example.dir/main.cpp.o.d -o CMakeFiles/Example.dir/main.cpp.o -c /home/linus/Dev/example/main.cpp
In file included from /var/home/linus/Dev/example/main.cpp:1:
/home/linus/Dev/serenity/Build/x86_64/Root/usr/include/LibGUI/ConnectionToWindowServer.h:10:10: fatal error: WindowServer/ScreenLayout.h: No such file or directory
10 | #include <WindowServer/ScreenLayout.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
cc @ADKaster
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too