diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 1de1882248fd47c3ae0096d850979115719ba0a5..ffee5fadb280b435c5f82fbe06d9e6e6ee25dce6 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -21,6 +21,12 @@ include(Python) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) + +# https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ +set(CMAKE_MACOSX_RPATH ON) +set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH OFF) set(LIBS_CLOSED_PREFIX) set(LIBS_OPEN_PREFIX) @@ -234,16 +240,16 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL fast) set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO) set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH YES) + set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES) if (${CMAKE_BUILD_TYPE} STREQUAL "Release") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) else (${CMAKE_BUILD_TYPE} STREQUAL "Release") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf) endif (${CMAKE_BUILD_TYPE} STREQUAL "Release") if(USE_LTO) - set(CMAKE_XCODE_ATTRIBUTE_LLVM_LTO YES_THIN) - else() - set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING YES) + set(CMAKE_XCODE_ATTRIBUTE_LLVM_LTO YES_THIN) endif() + set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING YES) if (USE_AVX2) set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS avx2) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 1ab2cf517c15f85c09a60e2c36d4f50e8c62db09..63c6f6f3cbe0fb0c03427a048671d99e55a7d755 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -69,7 +69,9 @@ elseif (DARWIN) set_target_properties(AlchemyPlugin PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist + XCODE_ATTRIBUTE_DEPLOYMENT_POSTPROCESSING YES ) + # Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later) add_custom_command( diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 60c1ea62e8ad00f0f49bd62695a433589e30e416..1b2ae64165c66580ff885a15b71c790da836eeb6 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -107,6 +107,7 @@ if (DARWIN) INSTALL_RPATH "@executable_path/../../../.." BUILD_WITH_INSTALL_RPATH TRUE LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" - ) + XCODE_ATTRIBUTE_DEPLOYMENT_POSTPROCESSING YES + ) endif (DARWIN) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index bd8938e794d061a116519b557404b0a8fdda3efe..d62563cae6347bc4c60814db793de17898967716 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -78,6 +78,7 @@ if (DARWIN) BUILD_WITH_INSTALL_RPATH TRUE INSTALL_NAME_DIR "@executable_path" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" - ) + XCODE_ATTRIBUTE_DEPLOYMENT_POSTPROCESSING YES + ) endif (DARWIN) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index efee064bfc013c002cfca8af97e2ea4e3468ff12..149f660e0f7173c5b1a5588ae3c6c271c5dfe5dd 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1494,12 +1494,6 @@ if (DARWIN) alchemy.icns Info-Alchemy.plist Alchemy.xib - # CMake doesn't seem to support Xcode language variants well just yet - English.lproj/InfoPlist.strings - English.lproj/language.txt - German.lproj/language.txt - Japanese.lproj/language.txt - Korean.lproj/language.txt ) set_source_files_properties( ${viewer_RESOURCE_FILES} @@ -1906,7 +1900,7 @@ if (WINDOWS) --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} - --channel="${VIEWER_CHANNEL}" + --channel=${VIEWER_CHANNEL} --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} @@ -1963,7 +1957,7 @@ if (WINDOWS) --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} - --channel="${VIEWER_CHANNEL}" + --channel=${VIEWER_CHANNEL} --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} @@ -1989,7 +1983,8 @@ if (WINDOWS) elseif (DARWIN) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES - LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" + LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" + XCODE_ATTRIBUTE_DEPLOYMENT_POSTPROCESSING YES ) else (WINDOWS) # Linux @@ -2106,7 +2101,7 @@ if (LINUX) --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} - "--channel=${VIEWER_CHANNEL}" + --channel=${VIEWER_CHANNEL} --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} @@ -2131,7 +2126,7 @@ if (LINUX) --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} - --channel="${VIEWER_CHANNEL}" + --channel=${VIEWER_CHANNEL} --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} @@ -2170,9 +2165,6 @@ if (DARWIN) set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013-2019 Alchemy Viewer Project") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "Alchemy") set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "LLNSApplication") - - # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ - set(CMAKE_MACOSX_RPATH 1) set_target_properties( ${VIEWER_BINARY_NAME} @@ -2180,10 +2172,7 @@ if (DARWIN) RESOURCE "${viewer_RESOURCE_FILES}" OUTPUT_NAME "${product}" # From Contents/MacOS/SecondLife, look in Contents/Frameworks - INSTALL_RPATH "@loader_path/../Frameworks" - # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply - # does not work. Try this: - LINK_FLAGS "-rpath @loader_path/../Frameworks" + INSTALL_RPATH "@executable_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-Alchemy.plist" ) @@ -2209,7 +2198,7 @@ if (DARWIN) --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} --bundleid=${MACOSX_BUNDLE_GUI_IDENTIFIER} - --channel="${VIEWER_CHANNEL}" + --channel=${VIEWER_CHANNEL} --configuration=${CMAKE_CFG_INTDIR} --dest=${VIEWER_APP_BUNDLE} --grid=${GRID} @@ -2240,7 +2229,7 @@ if (DARWIN) --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} - --channel="${VIEWER_CHANNEL}" + --channel=${VIEWER_CHANNEL} --configuration=${CMAKE_CFG_INTDIR} --dest=${VIEWER_APP_BUNDLE} --grid=${GRID}