diff --git a/.github/workflows/ladybird-js-artifacts.yml b/.github/workflows/ladybird-js-artifacts.yml index bcb281ab94d..5dba796bf91 100644 --- a/.github/workflows/ladybird-js-artifacts.yml +++ b/.github/workflows/ladybird-js-artifacts.yml @@ -50,8 +50,10 @@ jobs: - name: Create build directory Ubuntu run: | cmake --preset CI -B Build \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=gcc-13 \ - -DCMAKE_CXX_COMPILER=g++-13 + -DCMAKE_CXX_COMPILER=g++-13 \ + -DENABLE_GUI_TARGETS=OFF if: ${{ matrix.os == 'ubuntu-22.04' }} env: CCACHE_DIR: ${{ env.SERENITY_CCACHE_DIR }} @@ -64,7 +66,8 @@ jobs: run: | cmake --preset CI -B Build \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" + -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \ + -DENABLE_GUI_TARGETS=OFF if: ${{ matrix.os == 'macos-14' }} env: CCACHE_DIR: ${{ env.SERENITY_CCACHE_DIR }} diff --git a/.github/workflows/libjs-test262.yml b/.github/workflows/libjs-test262.yml index a8c90e01efe..47b94de920d 100644 --- a/.github/workflows/libjs-test262.yml +++ b/.github/workflows/libjs-test262.yml @@ -99,7 +99,7 @@ jobs: -DCMAKE_CXX_COMPILER=g++-13 \ -DWASM_SPEC_TEST_SKIP_FORMATTING=ON \ -DINCLUDE_WASM_SPEC_TESTS=ON \ - -DENABLE_QT=OFF + -DENABLE_GUI_TARGETS=OFF ninja -C libjs-test262/Build test262-runner test-js test-wasm - name: Run test262 and test262-parser-tests diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b67f0136db..57844b303c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ if (ANDROID AND ENABLE_QT) set(ENABLE_QT OFF CACHE BOOL "" FORCE) endif() -if (ENABLE_QT) +if (ENABLE_QT AND ENABLE_GUI_TARGETS) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) @@ -80,7 +80,9 @@ endif() include(CTest) # for BUILD_TESTING option, default ON -add_subdirectory(Ladybird) +if (ENABLE_GUI_TARGETS) + add_subdirectory(Ladybird) +endif() add_custom_target(lint-shell-scripts COMMAND "${ladybird_SOURCE_DIR}/Meta/lint-shell-scripts.sh" diff --git a/Meta/CMake/common_options.cmake b/Meta/CMake/common_options.cmake index 5379cf21023..85983fe20cf 100644 --- a/Meta/CMake/common_options.cmake +++ b/Meta/CMake/common_options.cmake @@ -26,3 +26,5 @@ serenity_option(ENABLE_NETWORK_DOWNLOADS ON CACHE BOOL "Allow downloads of requi serenity_option(ENABLE_CLANG_PLUGINS OFF CACHE BOOL "Enable building with the Clang plugins") serenity_option(ENABLE_CLANG_PLUGINS_INVALID_FUNCTION_MEMBERS OFF CACHE BOOL "Enable detecting invalid function types as members of GC-allocated objects") + +serenity_option(ENABLE_GUI_TARGETS ON CACHE BOOL "Enable building GUI targets") diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 3f9a30ad765..22eafef3e7e 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -389,13 +389,10 @@ set(lagom_standard_libraries Compress Crypto Diff - Gfx HTTP - ImageDecoderClient IPC JS Line - Media Protocol Regex RIFF @@ -406,12 +403,20 @@ set(lagom_standard_libraries Unicode URL Wasm - Web WebSocket - WebView XML ) +if (ENABLE_GUI_TARGETS) + list(APPEND lagom_standard_libraries + Gfx + ImageDecoderClient + Media + WebView + Web + ) +endif() + target_link_libraries(LibCore PRIVATE LibURL Threads::Threads) if (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") # NetBSD has its shm_open and shm_unlink functions in librt so we need to link that @@ -450,15 +455,16 @@ endif() lagom_utility(abench SOURCES ../../Userland/Utilities/abench.cpp LIBS LibMain LibFileSystem LibAudio) lagom_utility(aconv SOURCES ../../Userland/Utilities/aconv.cpp LIBS LibMain LibFileSystem LibAudio) -lagom_utility(animation SOURCES ../../Userland/Utilities/animation.cpp LIBS LibGfx LibMain) +if (ENABLE_GUI_TARGETS) + lagom_utility(animation SOURCES ../../Userland/Utilities/animation.cpp LIBS LibGfx LibMain) + lagom_utility(icc SOURCES ../../Userland/Utilities/icc.cpp LIBS LibGfx LibMain LibURL) + lagom_utility(image SOURCES ../../Userland/Utilities/image.cpp LIBS LibGfx LibMain) + lagom_utility(ttfdisasm SOURCES ../../Userland/Utilities/ttfdisasm.cpp LIBS LibGfx LibMain) +endif() -lagom_utility(gzip SOURCES ../../Userland/Utilities/gzip.cpp LIBS LibCompress LibMain) - -lagom_utility(icc SOURCES ../../Userland/Utilities/icc.cpp LIBS LibGfx LibMain LibURL) -lagom_utility(image SOURCES ../../Userland/Utilities/image.cpp LIBS LibGfx LibMain) -lagom_utility(ttfdisasm SOURCES ../../Userland/Utilities/ttfdisasm.cpp LIBS LibGfx LibMain) lagom_utility(js SOURCES ../../Userland/Utilities/js.cpp LIBS LibCrypto LibJS LibLine LibUnicode LibMain LibTextCodec Threads::Threads) +lagom_utility(gzip SOURCES ../../Userland/Utilities/gzip.cpp LIBS LibCompress LibMain) lagom_utility(lzcat SOURCES ../../Userland/Utilities/lzcat.cpp LIBS LibCompress LibMain) lagom_utility(tar SOURCES ../../Userland/Utilities/tar.cpp LIBS LibArchive LibCompress LibFileSystem LibMain) @@ -509,18 +515,23 @@ if (BUILD_TESTING) AK LibCrypto LibCompress - LibGfx - LibMedia LibTest LibTextCodec - LibTTF LibUnicode LibURL - LibWeb - LibWebView LibXML ) + if (ENABLE_GUI_TARGETS) + list(APPEND TEST_DIRECTORIES + LibGfx + LibMedia + LibTTF + LibWeb + LibWebView + ) + endif() + if (ENABLE_CLANG_PLUGINS AND CMAKE_CXX_COMPILER_ID MATCHES "Clang$") list(APPEND TEST_DIRECTORIES ClangPlugins) endif()