Skip to content
Open
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
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ elseif(IOS)
set(DEPLOYMENT_TARGET "13" CACHE STRING "")
endif()

if(CMAKE_HOST_APPLE
AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR
AND NOT CMAKE_TOOLCHAIN_FILE
AND NOT IOS
AND NOT VISIONOS
AND NOT CMAKE_OSX_SYSROOT)
# Use one coherent Xcode SDK for headers and frameworks. Leaving this empty
# can mix Command Line Tools headers with frameworks from the selected
# Xcode, which turns SDK-only diagnostics into warnings-as-errors.
set(CMAKE_OSX_SYSROOT macosx CACHE STRING "macOS SDK" FORCE)
endif()

project(BabylonNative)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand Down
10 changes: 10 additions & 0 deletions Dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ endif()
# --------------------------------------------------
FetchContent_MakeAvailable_With_Message(JsRuntimeHost)

if(APPLE AND NAPI_JAVASCRIPT_ENGINE STREQUAL "JavaScriptCore" AND TARGET napi)
# find_library adds the SDK framework directory with -F, which does not
# classify framework headers as system headers. JsRuntimeHost uses
# -pedantic -Werror, so make that classification explicit for napi and all
# consumers while preserving warnings-as-errors for project sources.
get_filename_component(_JAVASCRIPTCORE_FRAMEWORKS_DIR "${JAVASCRIPTCORE_LIBRARY}" DIRECTORY)
target_compile_options(napi PUBLIC "SHELL:-iframework ${_JAVASCRIPTCORE_FRAMEWORKS_DIR}")
unset(_JAVASCRIPTCORE_FRAMEWORKS_DIR)
endif()
Comment on lines +194 to +202

# --------------------------------------------------
# metal-cpp
# --------------------------------------------------
Expand Down