Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build iOS libraries as Frameworks when building dynamic libraries #465

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from
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
1 change: 1 addition & 0 deletions physx/buildtools/presets/public/ios64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/ios64/PhysX" comment="Install path relative to PhysX SDK root" />
<cmakeParam name="IOS_DEPLOYMENT_TARGET" value="10.0" comment="iOS minimum deployment target" />
</CMakeParams>
</preset>
37 changes: 36 additions & 1 deletion physx/source/compiler/cmake/ios/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
##
## Copyright (c) 2008-2021 NVIDIA Corporation. All rights reserved.

IF(DEFINED IOS_DEPLOYMENT_TARGET)
SET(CMAKE_OSX_DEPLOYMENT_TARGET ${IOS_DEPLOYMENT_TARGET} CACHE STRING
"iOS deployment target" FORCE)
ENDIF()

SET(PHYSX_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -ferror-limit=0 -Wall -Wextra -Werror -fstrict-aliasing -Wstrict-aliasing=2 -Weverything -Wno-unknown-warning-option -Wno-documentation-deprecated-sync -Wno-documentation-unknown-command -Wno-float-equal -Wno-padded -Wno-weak-vtables -Wno-cast-align -Wno-conversion -Wno-missing-noreturn -Wno-missing-variable-declarations -Wno-shift-sign-overflow -Wno-covered-switch-default -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes -Wno-unreachable-code -Wno-unused-macros -Wno-unused-member-function -Wno-used-but-marked-unused -Wno-weak-template-vtables -Wno-deprecated -Wno-non-virtual-dtor -Wno-invalid-noreturn -Wno-return-type-c-linkage -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-unused-local-typedef -Wno-old-style-cast -Wno-newline-eof -Wno-unused-private-field -Wno-undefined-reinterpret-cast -Wno-invalid-offsetof -Wno-zero-as-null-pointer-constant -Wno-atomic-implicit-seq-cst -gdwarf-2" CACHE INTERNAL "PhysX CXX")

Expand Down Expand Up @@ -89,4 +93,35 @@ SET_PROPERTY(TARGET SimulationController PROPERTY FOLDER "PhysX SDK")
SET_PROPERTY(TARGET FastXml PROPERTY FOLDER "PhysX SDK")
SET_PROPERTY(TARGET PhysXPvdSDK PROPERTY FOLDER "PhysX SDK")
SET_PROPERTY(TARGET PhysXTask PROPERTY FOLDER "PhysX SDK")
SET_PROPERTY(TARGET PhysXFoundation PROPERTY FOLDER "PhysX SDK")
SET_PROPERTY(TARGET PhysXFoundation PROPERTY FOLDER "PhysX SDK")

IF(PHYSXCOMMON_LIBTYPE STREQUAL "SHARED")
SET(PHYSX_IOS_IDENTIFIER "com.nvidia.lib.physx")
SET(PHYSX_COMMON_IOS_IDENTIFIER "com.nvidia.lib.physxcommon")
SET(PHYSX_COOKING_IOS_IDENTIFIER "com.nvidia.lib.physxcooking")
SET(PHYSX_FOUNDATION_IOS_IDENTIFIER "com.nvidia.lib.physxfoundation")

SET_TARGET_PROPERTIES(PhysX PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER ${PHYSX_IOS_IDENTIFIER}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${PHYSX_IOS_IDENTIFIER}
)

SET_TARGET_PROPERTIES(PhysXCommon PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER ${PHYSX_COMMON_IOS_IDENTIFIER}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${PHYSX_COMMON_IOS_IDENTIFIER}
)

SET_TARGET_PROPERTIES(PhysXCooking PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER ${PHYSX_COOKING_IOS_IDENTIFIER}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${PHYSX_COOKING_IOS_IDENTIFIER}
)

SET_TARGET_PROPERTIES(PhysXFoundation PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER ${PHYSX_FOUNDATION_IOS_IDENTIFIER}
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${PHYSX_FOUNDATION_IOS_IDENTIFIER}
)
ENDIF()