diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index 26727f3f29..8b4faa50b7 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -29,10 +29,16 @@ if (HAVOK) #target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub) else() target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions) + target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 ) endif() elseif (HAVOK_TPV) use_prebuilt_binary(llphysicsextensions_tpv) - target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions_tpv) + # Done in newview/CMakeLists.txt for darwin if Havok is enabled + if (NOT DARWIN) + target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions_tpv) + target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 ) + endif() + # # include paths for LLs version and ours are different. target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) # @@ -42,7 +48,7 @@ elseif (HAVOK_TPV) # endif () -if ((NOT HAVOK AND NOT HAVOK_TPV) OR DARWIN) # ARM64 requires ndPhyicsStub +if ((NOT HAVOK AND NOT HAVOK_TPV) OR DARWIN) # ARM64 requires ndPhysicsStub use_prebuilt_binary( ndPhysicsStub ) # Don't set this variable, there is no need to build any stub source if using ndPhysicsStub @@ -69,7 +75,7 @@ if ((NOT HAVOK AND NOT HAVOK_TPV) OR DARWIN) # ARM64 requires ndPhyicsSt libnd_Pathing.a PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - if (NOT HAVOK AND NOT HAVOK_TPV) # Done in newview/CMakeLists.txt for darwin if Havok is enabled + if (NOT HAVOK AND NOT HAVOK_TPV) # Done in newview/CMakeLists.txt for darwin if Havok is enabled target_link_libraries(llphysicsextensions_impl INTERFACE ${ND_HACDCONVEXDECOMPOSITION_LIBRARY} ${HACD_LIBRARY} ${ND_PATHING_LIBRARY}) endif() # @@ -82,4 +88,4 @@ endif () # include paths for LLs version and ours are different. #target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) -# \ No newline at end of file +# diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index ef597a01c4..bc9256ac7b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -60,7 +60,7 @@ include(Discord) if (LLPHYSICSEXTENSIONS_SRC_DIR) # -if (NOT HAVOK_TPV) +if (HAVOK) # When using HAVOK_TPV, the library is precompiled, so no need for this # Stub and probably havok lib itself is a hack, autobuild loads a 3p that really is a source tarball @@ -86,7 +86,7 @@ if (NOT HAVOK_TPV) target_compile_options( llphysicsextensions PRIVATE -Wno-unused-local-typedef) endif (DARWIN) endif() -endif (NOT HAVOK_TPV) +endif () # endif (LLPHYSICSEXTENSIONS_SRC_DIR) @@ -2233,10 +2233,6 @@ if (WINDOWS) list(APPEND viewer_SOURCE_FILES ${viewer_INSTALLER_FILES}) endif (WINDOWS) -if (HAVOK OR HAVOK_TPV) - set(LLSTARTUP_COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS} -DLL_HAVOK") -endif (HAVOK OR HAVOK_TPV) - if( DEFINED LLSTARTUP_COMPILE_FLAGS ) # progress view disables/enables icons based on available packages set_source_files_properties(llprogressview.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}") @@ -2521,7 +2517,7 @@ elseif (DARWIN) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES # arch specific flags for universal builds: https://stackoverflow.com/a/77942065 - XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL" + XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL -DLL_HAVOK=1" XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=arm64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_STUB" # only generate the .MAP file for llphysicsextensions_tpv on x86_64 XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensions/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensions -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" @@ -2531,9 +2527,9 @@ elseif (DARWIN) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES # arch specific flags for universal builds: https://stackoverflow.com/a/77942065 - XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL" + XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL -DLL_HAVOK=1" # only generate the .MAP file for llphysicsextensions_tpv on x86_64 - XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${ARCH_PREBUILT_DIRS}/ -lllphysicsextensions_tpv" + XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -lllphysicsextensions_tpv" XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) \ ${ND_HACDCONVEXDECOMPOSITION_LIBRARY} \ ${HACD_LIBRARY} \