aboutsummaryrefslogtreecommitdiff
path: root/NvCloth/compiler/cmake/Linux
diff options
context:
space:
mode:
authormtamis <[email protected]>2017-02-15 16:06:25 +0100
committermtamis <[email protected]>2017-02-15 16:06:25 +0100
commit85305930aeeb1d513e23522bd91f29ba81aa6d14 (patch)
tree45f1bb20a45a300d1fef107e436cac95602a0e57 /NvCloth/compiler/cmake/Linux
downloadnvcloth-85305930aeeb1d513e23522bd91f29ba81aa6d14.tar.xz
nvcloth-85305930aeeb1d513e23522bd91f29ba81aa6d14.zip
NvCloth library v1.0.0
Diffstat (limited to 'NvCloth/compiler/cmake/Linux')
-rw-r--r--NvCloth/compiler/cmake/Linux/CMakeLists.txt55
-rw-r--r--NvCloth/compiler/cmake/Linux/NvCloth.cmake59
2 files changed, 114 insertions, 0 deletions
diff --git a/NvCloth/compiler/cmake/Linux/CMakeLists.txt b/NvCloth/compiler/cmake/Linux/CMakeLists.txt
new file mode 100644
index 0000000..4d8d85a
--- /dev/null
+++ b/NvCloth/compiler/cmake/Linux/CMakeLists.txt
@@ -0,0 +1,55 @@
+cmake_minimum_required(VERSION 3.3)
+MESSAGE("[NvCloth]cmake/Linux/CMakeList.txt")
+include(../common/CMakeLists.txt)
+
+
+IF(NOT DEFINED TARGET_BUILD_PLATFORM) # Not defined, default to Linux
+ SET(TARGET_BUILD_PLATFORM "Linux")
+ENDIF()
+
+SET(PLATFORM_LIST Linux)
+
+IF (NOT ${TARGET_BUILD_PLATFORM} IN_LIST PLATFORM_LIST)
+ MESSAGE(FATAL_ERROR "Invalid platform:" ${TARGET_BUILD_PLATFORM})
+ENDIF()
+
+IF (DEFINED PX_32BIT)
+SET(CMAKE_CXX_FLAGS "-arch i386 -msse2 -std=c++11 -fno-rtti -fno-exceptions -ffast-math -ffunction-sections -fdata-sections -Werror -ferror-limit=0 -Wall -Wextra -fstrict-aliasing -Wstrict-aliasing=2 -Weverything -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 -gdwarf-2 -Wno-unused-value -Wno-format-nonliteral -Wno-undef")
+ELSEIF()
+SET(CMAKE_CXX_FLAGS "-arch x86_64 -msse2 -std=c++11 -fno-rtti -fno-exceptions -ffast-math -ffunction-sections -fdata-sections -Werror -ferror-limit=0 -Wall -Wextra -fstrict-aliasing -Wstrict-aliasing=2 -Weverything -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 -gdwarf-2 -Wno-unused-value -Wno-format-nonliteral -Wno-undef")
+ENDIF()
+
+SET(CMAKE_SHARED_LINKER_FLAGS "")
+
+# Build debug info for all configurations
+SET(CMAKE_CXX_FLAGS_DEBUG "-std=c++11 -O0 -g3 -gdwarf-2")
+SET(CMAKE_CXX_FLAGS_CHECKED "-std=c++11 -g3 -gdwarf-2 -O3")
+SET(CMAKE_CXX_FLAGS_PROFILE "-std=c++11 -O3 -g")
+SET(CMAKE_CXX_FLAGS_RELEASE "-std=c++11 -O3 -g")
+
+
+#set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym")
+
+# Controls PX_NVTX for all projects on linux
+SET(PHYSX_LINUX_ENABLE_NVTX 0)
+
+# Disable cuda and dx for all projects on Linux
+SET(PHYSX_LINUX_COMPILE_DEFS DISABLE_COMPUTE_PHYSX)
+SET(PHYSX_LINUX_DEBUG_COMPILE_DEFS _DEBUG;PX_DEBUG=1;PX_CHECKED=1;PX_NVTX=${PHYSX_MAC_ENABLE_NVTX};PX_SUPPORT_PVD=0)
+SET(PHYSX_LINUX_CHECKED_COMPILE_DEFS NDEBUG;PX_CHECKED=1;PX_NVTX=${PHYSX_MAC_ENABLE_NVTX};PX_SUPPORT_PVD=0)
+SET(PHYSX_LINUX_PROFILE_COMPILE_DEFS NDEBUG;PX_PROFILE=1;PX_NVTX=${PHYSX_MAC_ENABLE_NVTX};PX_SUPPORT_PVD=0)
+SET(PHYSX_LINUX_RELEASE_COMPILE_DEFS NDEBUG;PX_SUPPORT_PVD=0)
+
+SET(PX_SELECT_COMPONENTS PxFoundation)
+FIND_PACKAGE(PxShared REQUIRED)
+
+# Include the PxShared-exports.cmake file that PxShared created. There's other ways to do this, but there's a bunch of issues with it in a CI environment
+# such as - we don't want to be installing any built artifacts on this server, etc. So for now we hack it.
+
+# Add PxShared as a dependency so that we can use project references
+ADD_SUBDIRECTORY(${PXSHARED_ROOT_DIR}/src/compiler/cmake/Linux "${CMAKE_CURRENT_BINARY_DIR}/pxshared_bin")
+
+# Include all of the projects
+INCLUDE(NvCloth.cmake)
+
+
diff --git a/NvCloth/compiler/cmake/Linux/NvCloth.cmake b/NvCloth/compiler/cmake/Linux/NvCloth.cmake
new file mode 100644
index 0000000..f1b19d0
--- /dev/null
+++ b/NvCloth/compiler/cmake/Linux/NvCloth.cmake
@@ -0,0 +1,59 @@
+#
+# Build NvCloth (PROJECT not SOLUTION)
+#
+
+MESSAGE("[NvCloth]cmake/Linux/NvCloth.cmake")
+
+SET(GW_DEPS_ROOT $ENV{GW_DEPS_ROOT})
+FIND_PACKAGE(PxShared REQUIRED)
+
+
+#FIND_PACKAGE(nvToolsExt REQUIRED)
+
+SET(NVCLOTH_PLATFORM_INCLUDES
+ ${NVTOOLSEXT_INCLUDE_DIRS}
+)
+
+SET(NVCLOTH_PLATFORM_SOURCE_FILES
+ #${PROJECT_ROOT_DIR}/src/neon/NeonCollision.cpp
+ #${PROJECT_ROOT_DIR}/src/neon/NeonSelfCollision.cpp
+ #${PROJECT_ROOT_DIR}/src/neon/NeonSolverKernel.cpp
+ #${PROJECT_ROOT_DIR}/src/neon/SwCollisionHelpers.h
+)
+
+# Use generator expressions to set config specific preprocessor definitions
+SET(NVCLOTH_COMPILE_DEFS
+ NV_CLOTH_IMPORT=PX_DLL_EXPORT
+ NV_CLOTH_ENABLE_DX11=0
+ NV_CLOTH_ENABLE_CUDA=0
+
+ # Common to all configurations
+ ${PHYSX_LINUX_COMPILE_DEFS};PX_PHYSX_CORE_EXPORTS
+
+ $<$<CONFIG:debug>:${PHYSX_LINUX_DEBUG_COMPILE_DEFS};PX_PHYSX_DLL_NAME_POSTFIX=DEBUG;>
+ $<$<CONFIG:checked>:${PHYSX_LINUX_CHECKED_COMPILE_DEFS};PX_PHYSX_DLL_NAME_POSTFIX=CHECKED;>
+ $<$<CONFIG:profile>:${PHYSX_LINUX_PROFILE_COMPILE_DEFS};PX_PHYSX_DLL_NAME_POSTFIX=PROFILE;>
+ $<$<CONFIG:release>:${PHYSX_LINUX_RELEASE_COMPILE_DEFS};>
+)
+
+SET(NVCLOTH_LIBTYPE SHARED)
+
+# include common NvCloth settings
+INCLUDE(../common/NvCloth.cmake)
+
+
+# Add linked libraries
+# TARGET_LINK_LIBRARIES(NvCloth PUBLIC ${NVTOOLSEXT_LIBRARIES} LowLevel LowLevelAABB LowLevelCloth LowLevelDynamics LowLevelParticles PhysXCommon PhysXGpu PxFoundation PxPvdSDK PxTask SceneQuery SimulationController)
+
+TARGET_LINK_LIBRARIES(NvCloth PUBLIC PxFoundation)
+
+SET_TARGET_PROPERTIES(NvCloth PROPERTIES
+ LINK_FLAGS_DEBUG ""
+ LINK_FLAGS_CHECKED ""
+ LINK_FLAGS_PROFILE ""
+ LINK_FLAGS_RELEASE ""
+)
+
+# enable -fPIC so we can link static libs with the editor
+SET_TARGET_PROPERTIES(NvCloth PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
+MESSAGE("[NvCloth]cmake/Linux/NvCloth.cmake END") \ No newline at end of file