[webkit-changes] [WebKit/WebKit] 1ef249: [CMake] Add option to control assertions

Patrick noreply at github.com
Thu Aug 10 13:46:42 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1ef24965e556d8cf0e4344b0f5395d7e02cf005f
      https://github.com/WebKit/WebKit/commit/1ef24965e556d8cf0e4344b0f5395d7e02cf005f
  Author: Patrick Griffis <pgriffis at igalia.com>
  Date:   2023-08-10 (Thu, 10 Aug 2023)

  Changed paths:
    M Source/JavaScriptCore/API/tests/testapi.c
    M Source/JavaScriptCore/bytecode/CodeBlock.h
    M Source/WTF/wtf/RefCounter.h
    M Source/WebCore/layout/LayoutContext.h
    M Source/WebCore/platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h
    M Source/WebCore/platform/mediastream/MediaConstraints.cpp
    M Source/WebCore/platform/mediastream/MediaConstraints.h
    M Source/cmake/OptionsCommon.cmake

  Log Message:
  -----------
  [CMake] Add option to control assertions
https://bugs.webkit.org/show_bug.cgi?id=259982

Reviewed by Don Olmstead.

The macOS port already allows building `release+assert` but the
cmake project didn't expose this.

This adds a `-DENABLE_ASSERTS` option to enable with a normal
release build.

* Source/JavaScriptCore/API/tests/testapi.c:

Handle ASSERT_ENABLED being already defined here.

* Source/JavaScriptCore/bytecode/CodeBlock.h:
* Source/WTF/wtf/RefCounter.h:
(WTF::RefCounter<T>::Count::deref):
* Source/WebCore/layout/LayoutContext.h:
* Source/WebCore/platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h:
* Source/WebCore/platform/mediastream/MediaConstraints.cpp:
(WebCore::FlattenedConstraint::append):
* Source/WebCore/platform/mediastream/MediaConstraints.h:

There are a few cases in the codebase where they mix checking
NDEBUG and ASSERT_ENABLED between the declaration/definition/usage.
This just changes them to be in sync.

* Source/cmake/OptionsCommon.cmake:

Add the `ENABLE_ASSERTS` option.

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




More information about the webkit-changes mailing list