Skip to content

build: Static build behavior depends on the used compiler #21771

@hebasto

Description

@hebasto

The qt_mac_applicationIsInDarkMode function

bool qt_mac_applicationIsInDarkMode()
{
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
    if (__builtin_available(macOS 10.14, *)) {
        auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:
                @[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
        return [appearance isEqualToString:NSAppearanceNameDarkAqua];
    }
#endif
    return false;
}

behavior depends on the compiler that was used for static build.

It returns true or false depending on OS appearance setting on old compilers:

  • apple clang 10.0.1 on macOS Mojave 10.14.6 (18G8022)
  • llvm clang 8.0.0 used in depends

It always returns false on newer compilers:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions