Skip to content

Support SHARED FRAMEWORK targets in CMake RN #258

@kraenhansen

Description

@kraenhansen

We're currently expecting CMake projects to output "free" dynamic libraries (not wrapped in Apple frameworks) and it would be great if we supported use-cases where developers wants to control the framework options and skip the transformation from dynamic library to framework that CMake RN performs.

Documentation for CMake's support for outputting frameworks: https://cmake.org/cmake/help/latest/prop_tgt/FRAMEWORK.html

add_library(dynamicFramework SHARED
            dynamicFramework.c
            dynamicFramework.h
)
set_target_properties(dynamicFramework PROPERTIES
  FRAMEWORK TRUE
  FRAMEWORK_VERSION C
  MACOSX_FRAMEWORK_IDENTIFIER com.cmake.dynamicFramework
  MACOSX_FRAMEWORK_INFO_PLIST Info.plist
  # "current version" in semantic format in Mach-O binary file
  VERSION 16.4.0
  # "compatibility version" in semantic format in Mach-O binary file
  SOVERSION 1.0.0
  PUBLIC_HEADER dynamicFramework.h
  XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
)

It would be great if we added documentation and tests for this as well 🤞

Metadata

Metadata

Assignees

Labels

Apple 🍎Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.)CMake RNOur `cmake` wrapping CLIenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions