#
# Build PhysXCommon
#

FIND_PACKAGE(nvToolsExt REQUIRED)

SET(PHYSX_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../../)

SET(COMMON_SRC_DIR ${PHYSX_SOURCE_DIR}/Common/src)
SET(GU_SOURCE_DIR ${PHYSX_SOURCE_DIR}/GeomUtils)

SET(PHYSXCOMMON_LIBTYPE STATIC)

SET(PXCOMMON_PLATFORM_SRC_FILES 
)

SET(PXCOMMON_PLATFORM_INCLUDES
	${NVTOOLSEXT_INCLUDE_DIRS}
	${PHYSX_SOURCE_DIR}/Common/src/ios
)

SET(PXCOMMON_COMPILE_DEFS
	# Common to all configurations
	${PHYSX_IOS_COMPILE_DEFS};PX_FOUNDATION_DLL=1;PX_PHYSX_COMMON_EXPORTS;

	# Switch platforms here?
	$<$<CONFIG:debug>:${PHYSX_IOS_DEBUG_COMPILE_DEFS};PX_PHYSX_DLL_NAME_POSTFIX=DEBUG>
	$<$<CONFIG:checked>:${PHYSX_IOS_CHECKED_COMPILE_DEFS};PX_PHYSX_DLL_NAME_POSTFIX=CHECKED>
	$<$<CONFIG:profile>:${PHYSX_IOS_PROFILE_COMPILE_DEFS};PX_PHYSX_DLL_NAME_POSTFIX=PROFILE>
	$<$<CONFIG:release>:${PHYSX_IOS_RELEASE_COMPILE_DEFS}>
)

# include common PhysXCommon settings
INCLUDE(../common/PhysXCommon.cmake)

# Do final direct sets after the target has been defined
SET_TARGET_PROPERTIES(PhysXCommon PROPERTIES LINK_FLAGS ""	)

# enable -fPIC so we can link static libs with the editor
SET_TARGET_PROPERTIES(PhysXCommon PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
