From e3450853292dbd5d8177ca5b675bd351ebdd6511 Mon Sep 17 00:00:00 2001 From: nipos Date: Sun, 27 Aug 2023 20:53:47 +0200 Subject: [PATCH] Meta+Ladybird: Add some extra definitions for Haiku --- Ladybird/CMakeLists.txt | 7 +++++++ Meta/Lagom/CMakeLists.txt | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Ladybird/CMakeLists.txt b/Ladybird/CMakeLists.txt index 10aa871256..31ddad1297 100644 --- a/Ladybird/CMakeLists.txt +++ b/Ladybird/CMakeLists.txt @@ -45,6 +45,13 @@ if (ENABLE_UNDEFINED_SANITIZER) add_link_options(-fsanitize=undefined) endif() +if (HAIKU) + # Haiku needs some extra compile definitions to make important stuff in its headers available. + add_compile_definitions(_DEFAULT_SOURCE) + add_compile_definitions(_GNU_SOURCE) + add_compile_definitions(__USE_GNU) +endif() + # Lagom # FIXME: PROJECT_IS_TOP_LEVEL with CMake 3.21+ set(LADYBIRD_IS_TOP_LEVEL FALSE) diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 28da24c69e..cb798448f8 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -112,6 +112,13 @@ if (ENABLE_COMPILETIME_FORMAT_CHECK) add_compile_definitions(ENABLE_COMPILETIME_FORMAT_CHECK) endif() +if (HAIKU) + # Haiku needs some extra compile definitions to make important stuff in its headers available. + add_compile_definitions(_DEFAULT_SOURCE) + add_compile_definitions(_GNU_SOURCE) + add_compile_definitions(__USE_GNU) +endif() + if (ENABLE_FUZZERS) add_compile_options(-fno-omit-frame-pointer) endif()