mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Thread the static build configuration (formed from language options) in to the macro plugin handler, which will serialize it for use in the macro implementation. test this with a simple macro that checks whether a particular custom configuration (set via `-D`) is enabled or not. This required some re-layering, sinking the logic for building a StaticBuildConfiguration from language options down into a new swiftBasicSwift library, which sits on top of the C++ swiftBasic and provides Swift functionality for it. That can be used by the C++ swiftAST to cache the StaticBuildConfiguration on the ASTContext, making it available for other parts of ASTGen.
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
//===--- BasicSwift.h -------------------------------------------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2023 - 2025 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef SWIFT_BRIDGING_BASICSWIFT_H
|
|
#define SWIFT_BRIDGING_BASICSWIFT_H
|
|
|
|
#include "swift/Basic/BasicBridging.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/// Create a new static build configuration for the given language options.
|
|
void * _Nonnull swift_Basic_createStaticBuildConfiguration(BridgedLangOptions cLangOpts);
|
|
|
|
/// Free the given static build configuration.
|
|
void swift_Basic_freeStaticBuildConfiguration(void * _Nonnull staticBuildConfiguration);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // SWIFT_BRIDGING_BASICSWIFT_H
|