Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,11 @@ let compatibilityTestCondition = envBoolValue("COMPATIBILITY_TEST", default: fal
let useLocalDeps = envBoolValue("USE_LOCAL_DEPS")
let renderBoxCondtion = envBoolValue("RENDERBOX", default: buildForDarwinPlatform && !isSPIBuild)

/// CGFloat and CGRect def in CFCGTypes.h will conflict with Foundation's CGSize/CGRect def on Linux.
/// macOS: true -> no issue
/// macOS: false -> use Swift implementation with OpenCoreGraphics Swift CGPath
/// Linux: true + No CGPathRef support in ORBPath -> confilict with Foundation def
/// Linux: false -> use Swift implementation with OpenCoreGraphics Swift CGPath
// C geometry types conflict with Foundation's Swift geometry types on Linux.
// Disable this flag to use Swift Path instead of the C++ implementation.
let cfCGTypes = envBoolValue("CF_CGTYPES", default: buildForDarwinPlatform)
// Use OPENSWIFTUI_COREGRAPHICS to select the same backend in ORB and OCG shims.
let coreGraphicsCondition = envBoolValue("COREGRAPHICS", default: buildForDarwinPlatform)

// MARK: - Shared Settings

Expand Down Expand Up @@ -190,6 +189,10 @@ if cfCGTypes {
sharedSwiftSettings.append(.define("OPENRENDERBOX_CF_CGTYPES"))
}

if coreGraphicsCondition {
sharedSwiftSettings.append(.define("OPENRENDERBOX_COREGRAPHICS"))
}

// MARK: - Extension

extension Target {
Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenRenderBox/Animation/ORBSymbolUpdate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#if !canImport(ObjectiveC) || !OPENRENDERBOX_CF_CGTYPES
public import OpenCoreGraphicsShims
public import OpenRenderBoxCxx
public import OpenRenderBoxCxx.C
#endif

#if !canImport(ObjectiveC)
Expand Down
7 changes: 7 additions & 0 deletions Sources/OpenRenderBox/Export.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
// OpenRenderBox

#if SWIFT_PACKAGE
#if OPENRENDERBOX_COREGRAPHICS
@_exported public import OpenRenderBoxCxx
#if canImport(ObjectiveC)
@_exported public import OpenRenderBoxCxx.ObjC
#endif
#else
@_exported public import OpenRenderBoxCxx.C
#endif
#endif
Loading
Loading