[webkit-changes] [WebKit/WebKit] 3b5d8e: [CMake] Allow enabling C++ library assertions if s...

Adrian Perez noreply at github.com
Fri Feb 14 00:57:58 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3b5d8ebc05c0985537639b9eaa92ab722607a2fa
      https://github.com/WebKit/WebKit/commit/3b5d8ebc05c0985537639b9eaa92ab722607a2fa
  Author: Adrian Perez de Castro <aperez at igalia.com>
  Date:   2025-02-14 (Fri, 14 Feb 2025)

  Changed paths:
    M Source/cmake/OptionsCommon.cmake

  Log Message:
  -----------
  [CMake] Allow enabling C++ library assertions if supported
https://bugs.webkit.org/show_bug.cgi?id=266396

Reviewed by Michael Catanzaro.

Detect which C++ library is being used, and for the supported ones apply
the needed compilation options to have their assertions enabled. The
_LIBCPP_VERSION macro is used to detect libc++, and _GLIBCXX_RELEASE for
GNU libstdc++. If any of these C++ libraries are detected, then their
assertions are enabled by default. A new USE_CXX_STDLIB_ASSERTIONS CMake
option may be used used to override the default setting.

This change does not attempt to choose whether to use libc++, and the
mechanism to choose the C++ library being used remains unchanged. To
change e.g. from the GNU library to libc++ one still needs to set
environment variables accordingly before invoking CMake:

  CXX=clang++ CXXFLAGS='-stdlib=libc++' LDFLAGS='-stdlib=libc++' cmake ...

* Source/cmake/OptionsCommon.cmake: Add checks to determine which C++
standard library is being used and enable assertions where possible.

Canonical link: https://commits.webkit.org/290394@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list