Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alchemy/viewer
  • Miezhiko/alchemy-next
  • JennaHuntsman/xdg-integration
  • logue/alchemy-next
  • FelixWolf/alchemy-viewer
  • XenHat/xdg-integration
6 results
Show changes
Showing
with 953 additions and 625 deletions
A resident may swap out their sky for an EXR format HDRI for the purposes of previewing how their object would render in Second Life in an environment that matches the supplied HDRI. This should aid in matching inworld lighting with external tools so artists can know if their content has imported properly.
To load an HDRI, click Develop->Render Tests->HDRI Preview:
![image](https://github.com/secondlife/viewer/assets/23218274/fbdeab5f-dc1f-4406-be19-0c9ee7437b3f)
Choose an EXR image. A library of publicly available HDRIs can be found here: https://polyhaven.com/hdris
The Personal Lighting floater will open, and the sky will be replaced with the HDRI you chose. Reflection Probes will reset, and the scene will be illuminated by the HDRI.
Three debug settings affect how the HDRI is displayed:
RenderHDRIExposure - Exposure adjustment of HDRI when previewing an HDRI. Units are EV. Sane values would be -10 to 10.
RenderHDRIRotation - Rotation (in degrees) of environment when previewing an HDRI.
RenderHDRISplitScreen - What percentage of screen to render using HDRI vs EEP sky.
Exposure and Rotation should behave similarly to the rotation and exposure controls in Substance Painter.
Split Screen can be used to display an EEP sky side-by-side with an HDRI sky to aid in authoring an EEP sky that matches an HDRI sky. It is currently expected that EEP sun disc, moon, clouds, and stars do not render when previewing an HDRI, but that may change in the future.
# Material Preview
## Overview
Material preview is a UI feature which displays a lit spherical preview of a PBR material. It can be found in the following UIs:
- The material picker swatch
- In the build floater, in the Texture tab, when applying a PBR material
- (If the feature is enabled) In the Region/Estate floater, in the Terrain tab, when applying PBR materials to terrain
- In the floater to select a material from inventory, which can be opened by clicking the material picker swatch
## Known Issues
These are known issues that the current implementation of this feature does not address:
- The material preview in the build floater is a preview of the base material ID only, and ignores other properties on the prim face like material overrides (https://github.com/secondlife/viewer/issues/865)
- Alpha mask previews as alpha blend (https://github.com/secondlife/viewer/issues/866)
- Double-sided previews as single-sided (https://github.com/secondlife/viewer/issues/867)
- Material preview inherits some of its lighting from the current environment, and reflections from the default reflection probe (https://github.com/secondlife/viewer/issues/868)
## General Regression Testing
- Check that the material preview swatch looks OK with different materials selected
- Check that the material preview swatch runs reasonably well on different systems, especially when the select material from inventory floater is also open
- In particular: AMD, MacOS, minimum spec machines
- Watch out for regressions in rendering caused by opening a floater with a material preview swatch
## Bug Fixes
### Disappearing Objects Fix Test
This test is recommended for verifying that https://github.com/secondlife/viewer-issues/issues/72 is fixed.
#### Symptoms
When the bug occurs, one or more of following types of objects could randomly disappear in the world, permanently until relog:
- Objects
- Water level in current region
- Adjacent region/void water
Note: Disappearing objects in reflections have a different root cause and are not covered by the fix.
#### Bug Reproduction Steps
Verify the disappearing objects bug does not reproduce, given the following steps:
- Runtime prerequisites: Material preview swatch may not be available in your viewer or region if this feature is still behind a feature flag. It is safe to enable this feature manually by setting, "UIPreviewMaterial" to True in the advanced settings. The setting will persist for the current session.
- Region prerequisites: Unknown, but a region with lots of objects in it seems to increase repro rate. The following locations have been known to easily reproduce the bug, as of 2024-02-16:
- http://maps.secondlife.com/secondlife/LindenWorld%20B/161/75/47
- [secondlife://Aditi/secondlife/Rumpus%20Room%202048/128/128/24](secondlife://Aditi/secondlife/Rumpus%20Room%202048/128/128/24)
- Right click an object and select, "Edit item"
- Go to texture tab, select PBR Metallic Roughness from dropdown, and click the button to select material from inventory
- Ensure "Apply now" is checked in the inventory selection floater
- Alternate between different materials from the inventory selection floater
- Look around the world and check for permanently disappeared objects.
### Dynamic Exposure Influence Fix Test
This test is recommended for verifying that https://github.com/secondlife/viewer-issues/issues/72 is fixed.
#### Symptoms
Dynamic exposure in the world could be influenced by the material preview being displayed. If a material preview was being generated in a given frame, then, depending on the current environment, the user would observe an unpleasant flashing effect in the environment:
- The world view could suddenly get darker and then fade back to normal exposure levels
- The world view could suddenly get brighter and then fade back to normal exposure levels
#### Bug Reproduction Steps
Verify the dynamic exposure influence bug does not reproduce. Test using a few environment presets such as Default Midday, Sunset, and Midnight.
- Right click an object and select, "Edit item"
- Go to texture tab, select PBR Metallic Roughness from dropdown, and click the button to select material from inventory
- Alternate between different materials from the inventory selection floater
#### Regression Testing
Dynamic exposure in the world should continue to work correctly. In particular:
- Exposure should fade gradually from high exposure to low exposure and back as needed
- Exposure should decrease in brighter environments
- Exposure should increase in darker environments
Textures imported via Build->Upload->Material that have an all opaque (255) alpha channel should have their alpha channel removed before upload.
1. Make 4 images that have different colors but all 255 alpha channels
2. Upload them all using Build->Upload->Material, with one in each of the material texture slots
3. Verify that using the textures as a blinn-phong diffuse map does not make the corresponding face render in the alpha pass (face should stay visible after disabling alpha pass by unchecking Advanced->Render Types->Alpha).
# PBR Terrain Appearance
## Tiling
The southwest corner of a region with PBR materials should exactly match up with the bottom left corner of the material texture(s).
If two adjacent regions have the same PBR terrain settings, then:
- There should not be seams between the two regions at their shared border
- The ground should not suddenly slide beneath the avatar when moving between regions (except due to movement of the avatar, which is not covered by this test plan)
## Feature Gating
PBR terrain should have lower detail on lower graphics settings. PBR terrain will also not show emissive textures on some machines (like Macs) which do not support more than 16 textures.
### Triplanar Mapping
Triplanar mapping improves the texture repeats on the sides of terrain slopes.
Availability of Triplanar mapping:
- Medium-High and below: No triplanar mapping
- High and above: Triplanar mapping
### PBR Textures
At the highest graphics support level, PBR terrain supports all PBR textures.
Availability of PBR textures varies by machine and graphics setting:
- Low: Base color only (looks similar to texture terrain)
- Medium-Low, and machines that do not support greater than 16 textures such as Macs: All PBR textures enabled except emissive textures.
- Medium: All PBR textures enabled
### PBR Alpha
PBR terrain does not support materials with alpha blend or double-sided. In addition, the viewer does not make any guarantees about what will render behind the terrain if alpha is used.
# PBR Terrain Composition
## Feature Availability
PBR Terrain is visible for all viewers with the PBR Terrain feature, regardless of if the feature flag is enabled.
There is only one set of four asset IDs applied to the terrain. In other words, unlike PBR materials on prims, there is no fallback texture set for viewers that do not support PBR terrain. Viewers without support will view terrain as blank (solid grey or white).
## Editing Terrain Composition
All tests in this section assume the PBR terrain feature flag is enabled, and that the user has appropriate permissions to modify the terrain textures.
### Feature Availability
On the client, the advanced setting `RenderTerrainPBREnabled` is the PBR terrain feature flag.
The PBR terrain feature flag should be set automatically when logging in/teleporting to a new region.
- The flag should be enabled on regions where the PBR terrain feature is enabled
- Otherwise the flag should be disabled
When the PBR terrain feature flag is disabled:
- The "PBR Metallic Roughness" checkbox should not be visible
- The user should not be able to apply PBR terrain to the region, only textures.
When the PBR terrain feature flag is enabled:
- The "PBR Metallic Roughness" checkbox should be visible
- The user should be able to apply PBR terrain or textures to the region, depending on if the "PBR Metallic Roughness" checkbox is checked.
### Current Composition Type
When the Region/Estate floater is opened to the terrain Tab, the current terrain should be shown in the four swatches, and the "PBR Metallic Roughness" checkbox should be checked or unchecked accordingly.
- If it is texture terrain, the "PBR Metallic Roughness" checkbox should be unchecked, and the floater should display the four textures applied to the terrain.
- If it is material terrain, the "PBR Metallic Roughness" checkbox should be checked, and the floater should display the four materials applied to the terrain.
In addition, where possible, textual labels and descriptions in the tab should make sense given the current value of the "PBR Metallic Roughness" checkbox. If the checkbox is unchecked, the labels should refer to textures. If the checkbox is checked, the labels should refer to materials.
### Toggling Composition Type
When toggling the "PBR Metallic Roughness" checkbox to the opposite value, which does not correspond to the current terrain type, one of the following sets of four terrain swatches will be displayed:
- The default textures/materials
- For textures, this is the default terrain texture set
- For materials, this is all blank materials, but this is subject to change
- The previously applied texture/material set
- History is available on a best-effort basis only. In particular, the history does not persist on viewer restart.
When toggling back the "PBR Metallic Roughness" checkbox to the original value, assuming nothing else has changed, then the current terrain should be shown in the four swatches again.
### Saving Composition
A user with appropriate permissions can change and save the textures or materials to the terrain. If the "PBR Metallic Roughness" checkbox is checked, the user applies materials, otherwise the user applies textures.
The user should not be allowed to set the texture or material swatches to null.
Saving may fail for the following reasons:
- A terrain or material texture is invalid
- A terrain texture is greater than the max texture upload resolution
If saving the terrain fails for any reason, the terrain should not be updated.
Unlike a viewer without PBR terrain support, the new viewer will no longer treat textures with alpha channels as invalid.
## Graphics Features
Texture terrain with transparency is not permitted to be applied in the viewer.
See [PBR Terrain Appearance](./pbr_terrain_appearance.md) for supported PBR terrain features.
## Minimap
The minimap should display the terrain with appropriate textures and colors.
# Terrain Loading
## Behavior overview
- Texture terrain should load if textures are applied to the region, and no PBR Metallic Roughness materials are applied.
- PBR terrain should load if PBR materials are applied to the region, even if the RenderTerrainPBREnabled feature flag is disabled in debug settings. This setting only disables the display of PBR materials in the Region / Estate > Terrain UI.
- Related subsystem: A change to the PBR terrain loading system may affect the texture terrain loading system and vice-versa
- Related subsystem: Minimap should load if terrain loads
- They may not finish loading at the same time
## Implementation details
This section is provided mainly for clarification of how the terrain loading system works.
The simulator sends 4 terrain composition UUIDs to the viewer for the region. The viewer does not know ahead-of-time if the terrain composition uses textures or materials. Therefore, to expedite terrain loading, the viewer makes up to 8 "top-level" asset requests simultaneously:
- Up to 4 texture asset requests, one for each UUID
- Up to 4 material asset requests, one for each UUID
It is therefore expected that half of these asset lookups will fail.
The viewer inspects the load success of these top-level assets to make the binary decision of whether to render all 4 texture assets or all 4 material assets. This determines the choice of composition for terrain both in-world and on the minimap.
The minimap also attempts to wait for textures to partially load before it can render a tile for a given region:
- When rendering texture terrain, the minimap attempts to wait for top-level texture assets to partially load
- When rendering PBR material terrain, the minimap attempts to wait for any base color/emissive textures in the materials to partially load, if they are present
We don't make guarantees that the minimap tile will render for the region if any aforementioned required textures/materials fail to sufficiently load. However, the minimap may make a best-effort attempt to render the region by ignoring or replacing data.
......@@ -506,6 +506,13 @@
<boolean>false</boolean>
</map>
<key>VoiceSignalingRequest</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>false</boolean>
</map>
<!-- Server to client -->
<key>RequiredVoiceVersion</key>
<map>
......@@ -688,6 +695,9 @@
<key>ProvisionVoiceAccountRequest</key>
<boolean>false</boolean>
<key>VoiceSignalingRequest</key>
<boolean>false</boolean>
<key>RemoteParcelRequest</key>
<boolean>false</boolean>
......
......@@ -4,23 +4,75 @@
# other commands to guarantee full compatibility
# with the version specified
## 3.8 added VS_DEBUGGER_WORKING_DIRECTORY support
cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING
"The root project/makefile/solution name. Defaults to SecondLife.")
## 3.13/12 is needed for add_link_options/add_compile_definitions
## 3.14 added FILE CREATE_LINK
## 3.16 is needed for target_precompile_headers
## Nicky: Ideally we want at least 3.21 for good preset support
## We're not there yet, but once done, there is a kludge in Linking.cmake
# "if(${CMAKE_VERSION} VERSION_LESS "3.20.0")" that can also be removed
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
if(POLICY CMP0083)
cmake_policy(SET CMP0083 NEW)
endif()
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()
if(POLICY CMP0119)
cmake_policy(SET CMP0119 NEW)
endif()
set(ROOT_PROJECT_NAME "Alchemy" CACHE STRING
"The root project/makefile/solution name. Defaults to Alchemy.")
project(${ROOT_PROJECT_NAME})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(Variables)
include(BuildVersion)
# The viewer code base can now be successfully compiled with -std=c++14. But
# turning that on in the generic viewer-build-variables/variables file would
# potentially require tweaking each of our ~50 third-party library builds.
# Until we decide to set -std=c++14 in viewer-build-variables/variables, set
# it locally here: we want to at least prevent inadvertently reintroducing
# viewer code that would fail with C++14.
if(MSVC)
set(CMAKE_CXX_STANDARD 20)
else()
set(CMAKE_OBJCXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
enable_language(OBJCXX)
endif()
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_BINARY_DIR}")
include(conanbuildinfo OPTIONAL RESULT_VARIABLE USE_CONAN )
if( USE_CONAN )
set( USE_CONAN ON )
set( USE_AUTOBUILD_3P OFF )
conan_basic_setup(TARGETS NO_OUTPUT_DIRS)
add_compile_definitions(LL_USESYSTEMLIBS USE_CONAN NO_AUTOBUILD_3P)
else()
set( USE_CONAN OFF )
set( USE_AUTOBUILD_3P ON )
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_BUILD_TYPE)
set(Python3_FIND_VIRTUALENV FIRST)
find_package(Python3 COMPONENTS Interpreter)
include(Variables)
include(BuildVersion)
add_subdirectory(cmake)
add_subdirectory(deps)
add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
add_subdirectory(${LIBS_OPEN_PREFIX}llappearance)
......@@ -32,10 +84,12 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llkdu)
add_subdirectory(${LIBS_OPEN_PREFIX}llimagej2coj)
add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
add_subdirectory(${LIBS_OPEN_PREFIX}llmeshoptimizer)
add_subdirectory(${LIBS_OPEN_PREFIX}llmessage)
add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive)
add_subdirectory(${LIBS_OPEN_PREFIX}llrender)
add_subdirectory(${LIBS_OPEN_PREFIX}llvfs)
add_subdirectory(${LIBS_OPEN_PREFIX}llfilesystem)
add_subdirectory(${LIBS_OPEN_PREFIX}llwebrtc)
add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
......@@ -45,49 +99,38 @@ endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
add_custom_target(viewer)
add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger)
add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
if( LL_TESTS )
# Legacy C++ tests. Build always, run if LL_TESTS is true.
add_subdirectory(${VIEWER_PREFIX}test)
endif()
if (ENABLE_MEDIA_PLUGINS)
# viewer media plugins
add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
endif (ENABLE_MEDIA_PLUGINS)
if (LINUX)
add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
if (INSTALL_PROPRIETARY)
include(LLAppearanceUtility)
add_subdirectory(${LLAPPEARANCEUTILITY_SRC_DIR} ${LLAPPEARANCEUTILITY_BIN_DIR})
endif (INSTALL_PROPRIETARY)
add_dependencies(viewer linux-crash-logger-strip-target)
elseif (DARWIN)
add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
add_dependencies(viewer mac-crash-logger)
elseif (WINDOWS)
add_subdirectory(${VIEWER_PREFIX}win_crash_logger)
# cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake
if (EXISTS ${VIEWER_DIR}win_setup)
add_subdirectory(${VIEWER_DIR}win_setup)
endif (EXISTS ${VIEWER_DIR}win_setup)
# add_dependencies(viewer windows-setup windows-crash-logger)
add_dependencies(viewer windows-crash-logger)
endif (LINUX)
if (USE_BUGSPLAT)
if (BUGSPLAT_DB)
message(STATUS "Building with BugSplat; database '${BUGSPLAT_DB}'")
else (BUGSPLAT_DB)
message(WARNING "Building with BugSplat, but no database name set (BUGSPLAT_DB)")
endif (BUGSPLAT_DB)
endif (USE_BUGSPLAT)
add_subdirectory(${VIEWER_PREFIX}newview)
add_dependencies(viewer secondlife-bin)
add_dependencies(viewer alchemy-bin)
add_subdirectory(${VIEWER_PREFIX}doxygen EXCLUDE_FROM_ALL)
# sets the 'startup project' for debugging from visual studio.
set_property(
DIRECTORY ${VIEWER_PREFIX}
PROPERTY VS_STARTUP_PROJECT secondlife-bin
)
DIRECTORY ${VIEWER_PREFIX}
PROPERTY VS_STARTUP_PROJECT ${VIEWER_BINARY_NAME}
)
if (LL_TESTS)
# Define after the custom targets are created so
......
......@@ -12,211 +12,268 @@
# Also realize that CMAKE_CXX_FLAGS may already be partially populated on
# entry to this file.
#*****************************************************************************
include_guard()
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(CheckCXXCompilerFlag)
include(Variables)
# We go to some trouble to set LL_BUILD to the set of relevant compiler flags.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}")
# Given that, all the flags you see added below are flags NOT present in
# https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables.
# Before adding new ones here, it's important to ask: can this flag really be
# applied to the viewer only, or should/must it be applied to all 3p libraries
# as well?
include(SDL2)
# Portable compilation flags.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADDRESS_SIZE=${ADDRESS_SIZE}")
add_compile_definitions(
ADDRESS_SIZE=${ADDRESS_SIZE}
$<$<CONFIG:Debug>:_DEBUG>
$<$<CONFIG:Debug>:LL_DEBUG=1>
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:LL_RELEASE=1>
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:NDEBUG>
$<$<CONFIG:RelWithDebInfo>:LL_RELEASE_WITH_DEBUG_INFO=1>
$<$<CONFIG:Release>:LL_RELEASE_FOR_DOWNLOAD=1>
)
# Configure crash reporting
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
if(RELEASE_CRASH_REPORTING)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DLL_SEND_CRASH_REPORTS=1")
add_compile_definitions( LL_SEND_CRASH_REPORTS=1)
endif()
if(NON_RELEASE_CRASH_REPORTING)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DLL_SEND_CRASH_REPORTS=1")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1")
endif()
add_compile_definitions( LL_SEND_CRASH_REPORTS=1)
endif()
# Don't bother with a MinSizeRel build.
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
"Supported build types." FORCE)
# SIMD config
option(USE_AVX2 "Enable usage of the AVX2 instruction set" OFF)
option(USE_AVX "Enable usage of the AVX instruction set" OFF)
option(USE_SSE42 "Enable usage of the SSE4.2 instruction set" ON)
# Platform-specific compilation flags.
# Warnings
option(DISABLE_FATAL_WARNINGS "Disable warnings as errors" ON)
if(USE_LTO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ${USE_LTO})
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_C_VISIBILITY_PRESET "hidden")
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
# Platform-specific compilation flags.
if (WINDOWS)
# Don't build DLLs.
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_compile_options(/MP)
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_compile_options(-m${ADDRESS_SIZE})
endif ()
add_compile_definitions(
$<$<CONFIG:Debug>:_SCL_SECURE_NO_WARNINGS=1>
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:_ITERATOR_DEBUG_LEVEL=0>
LL_WINDOWS=1
NOMINMAX
UNICODE
_UNICODE
_CRT_SECURE_NO_WARNINGS
_CRT_NONSTDC_NO_DEPRECATE
_WINSOCK_DEPRECATED_NO_WARNINGS
_SILENCE_CXX20_CISO646_REMOVED_WARNING
)
# for "backwards compatibility", cmake sneaks in the Zm1000 option which royally
# screws incredibuild. this hack disables it.
# for details see: http://connect.microsoft.com/VisualStudio/feedback/details/368107/clxx-fatal-error-c1027-inconsistent-values-for-ym-between-creation-and-use-of-precompiled-headers
# http://www.ogre3d.org/forums/viewtopic.php?f=2&t=60015
# http://www.cmake.org/pipermail/cmake/2009-September/032143.html
string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo"
CACHE STRING "C++ compiler release-with-debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo"
CACHE STRING "C++ compiler release options" FORCE)
# zlib has assembly-language object files incompatible with SAFESEH
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099")
set(CMAKE_CXX_STANDARD_LIBRARIES "")
set(CMAKE_C_STANDARD_LIBRARIES "")
add_definitions(
/DNOMINMAX
# /DDOM_DYNAMIC # For shared library colladadom
)
add_compile_options(
/GS
/TP
/W3
/c
/Zc:forScope
/nologo
/Oy-
# /arch:SSE2
/fp:fast
)
$<$<CONFIG:Release>:/Zc:inline>
$<$<CONFIG:Release>:/fp:fast>
/Zi
/EHsc
/permissive-
/W3
/c
/Zc:__cplusplus
/Zc:preprocessor
/Zc:char8_t-
/nologo
)
add_link_options(
/DEBUG:FULL
/IGNORE:4099
)
# Nicky: x64 implies SSE2
if( ADDRESS_SIZE EQUAL 32 )
add_definitions( /arch:SSE2 )
if (ADDRESS_SIZE EQUAL 32)
add_compile_options(/arch:SSE2)
elseif (USE_AVX2)
add_compile_options(/arch:AVX2)
elseif (USE_AVX)
add_compile_options(/arch:AVX)
elseif (USE_SSE42)
add_compile_definitions(__SSE3__=1 __SSSE3__=1 __SSE4__=1 __SSE4_1__=1 __SSE4_2__=1)
else ()
add_compile_definitions(__SSE3__=1)
endif ()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_compile_options(/Zc:externConstexpr /ZH:SHA_256)
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_compile_options(/Qvec /Zc:dllexportInlines- /clang:-mprefer-vector-width=128 -fno-strict-aliasing -Wno-ignored-pragma-intrinsic -Wno-unused-local-typedef)
endif()
# Are we using the crummy Visual Studio KDU build workaround?
if (NOT VS_DISABLE_FATAL_WARNINGS)
add_definitions(/WX)
endif (NOT VS_DISABLE_FATAL_WARNINGS)
endif (WINDOWS)
if (LINUX)
set(CMAKE_SKIP_RPATH TRUE)
add_definitions(-D_FORTIFY_SOURCE=2)
set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-variable ${CMAKE_CXX_FLAGS}")
# gcc 4.3 and above don't like the LL boost and also
# cause warnings due to our use of deprecated headers
add_definitions(-Wno-parentheses)
if(FAVOR_AMD AND FAVOR_INTEL)
message(FATAL_ERROR "Cannot enable FAVOR_AMD and FAVOR_INTEL at the same time")
elseif(FAVOR_AMD)
add_compile_options(/favor:AMD64)
elseif(FAVOR_INTEL)
add_compile_options(/favor:INTEL64)
endif()
add_definitions(
-D_REENTRANT
if (USE_LTO)
add_link_options(
$<$<CONFIG:Release>:/OPT:REF>
$<$<CONFIG:Release>:/OPT:ICF>
)
add_compile_options(
-fexceptions
-fno-math-errno
-fno-strict-aliasing
-fsigned-char
-msse2
-mfpmath=sse
-pthread
elseif (INCREMENTAL_LINK)
add_link_options($<$<CONFIG:Release>:/INCREMENTAL>)
else ()
add_link_options(
$<$<CONFIG:Release>:/OPT:REF>
$<$<CONFIG:Release>:/OPT:ICF>
$<$<CONFIG:Release>:/INCREMENTAL:NO>
)
endif ()
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# This is a massive hack and makes me sad. clang-cl fails to find its own builtins library :/ x64 only for now.
set(CLANG_RT_NAMES clang_rt.builtins-x86_64)
find_library(CLANG_RT NAMES ${CLANG_RT_NAMES}
PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\LLVM\\LLVM]/lib/clang/${CMAKE_CXX_COMPILER_VERSION}/lib/windows
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM]/lib/clang/${CMAKE_CXX_COMPILER_VERSION}/lib/windows)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /defaultlib:\"${CLANG_RT}\"")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /defaultlib:\"${CLANG_RT}\"")
endif()
# force this platform to accept TOS via external browser
add_definitions(-DEXTERNAL_TOS)
if (NOT DISABLE_FATAL_WARNINGS)
add_compile_options(/WX)
endif (NOT DISABLE_FATAL_WARNINGS)
add_definitions(-DAPPID=secondlife)
add_compile_options(-fvisibility=hidden)
# don't catch SIGCHLD in our base application class for the viewer - some of
# our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The
# viewer doesn't need to catch SIGCHLD anyway.
add_definitions(-DLL_IGNORE_SIGCHLD)
if (ADDRESS_SIZE EQUAL 32)
add_compile_options(-march=pentium4)
endif (ADDRESS_SIZE EQUAL 32)
#add_compile_options(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2
if (NOT USESYSTEMLIBS)
# this stops us requiring a really recent glibc at runtime
add_compile_options(-fno-stack-protector)
# linking can be very memory-hungry, especially the final viewer link
set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory")
endif (NOT USESYSTEMLIBS)
string(REPLACE "/Ob2" "/Ob3" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
string(REPLACE "/Ob2" "/Ob3" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")
endif (LINUX)
# configure win32 API for 10 and above compatibility
set(WINVER "0x0A00" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
add_compile_definitions(WINVER=${WINVER} _WIN32_WINNT=${WINVER})
endif (WINDOWS)
if (LINUX)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
if (DARWIN)
# Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default
set(CLANG_DISABLE_FATAL_WARNINGS OFF)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations")
# Ensure that CMAKE_CXX_FLAGS has the correct -g debug information format --
# see Variables.cmake.
string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}"
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# The viewer code base can now be successfully compiled with -std=c++14. But
# turning that on in the generic viewer-build-variables/variables file would
# potentially require tweaking each of our ~50 third-party library builds.
# Until we decide to set -std=c++14 in viewer-build-variables/variables, set
# it locally here: we want to at least prevent inadvertently reintroducing
# viewer code that would fail with C++14.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags} -std=c++14")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
## Really?? On developer machines too?
##set(ENABLE_SIGNING TRUE)
##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
endif (DARWIN)
add_compile_definitions(
LL_LINUX=1
APPID=secondlife
LL_IGNORE_SIGCHLD
_REENTRANT
$<$<CONFIG:Release>:_FORTIFY_SOURCE=2>
)
add_compile_options(
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:-fstack-protector>
-fexceptions
-fno-math-errno
-fno-strict-aliasing
-fno-omit-frame-pointer
-fsigned-char
-g
-gz
-pthread
)
if (USE_AVX2)
add_compile_options(-mavx2)
elseif (USE_AVX)
add_compile_options(-mavx)
elseif (USE_SSE42)
add_compile_options(-mfpmath=sse -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2)
else()
add_compile_options(-mfpmath=sse -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1)
endif ()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (USE_ASAN)
add_compile_options(-fsanitize=address -fsanitize-recover=address)
link_libraries(-lasan)
elseif (USE_LEAKSAN)
add_compile_options(-fsanitize=leak)
link_libraries(-llsan)
elseif (USE_UBSAN)
add_compile_options(-fsanitize=undefined -fno-sanitize=vptr)
link_libraries(-lubsan)
elseif (USE_THDSAN)
add_compile_options(-fsanitize=thread)
endif ()
endif ()
if (USE_ASAN OR USE_LEAKSAN OR USE_UBSAN OR USE_THDSAN)
add_compile_options(-Og)
else ()
add_compile_options(-O3)
endif ()
# Enable these flags so we have a read only GOT and some linking opts
add_link_options("LINKER:-z,relro" "LINKER:-z,now" "LINKER:--as-needed" "LINKER:--build-id=uuid")
endif ()
if (DARWIN)
add_compile_definitions(LL_DARWIN=1 GL_SILENCE_DEPRECATION=1)
add_link_options("LINKER:-headerpad_max_install_names" "LINKER:-search_paths_first" "LINKER:-dead_strip")
add_compile_options(
-O3
-gdwarf-2
-fno-strict-aliasing
-msse4.2
$<$<COMPILE_LANGUAGE:OBJCXX>:-fobjc-arc>
$<$<COMPILE_LANGUAGE:OBJCXX>:-fobjc-weak>
)
endif ()
if (LINUX OR DARWIN)
if (CMAKE_CXX_COMPILER MATCHES ".*clang")
set(CMAKE_COMPILER_IS_CLANGXX 1)
endif (CMAKE_CXX_COMPILER MATCHES ".*clang")
if (CMAKE_COMPILER_IS_GNUCXX)
set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
elseif (CMAKE_COMPILER_IS_CLANGXX)
set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
add_compile_options(-Wall -Wno-sign-compare -Wno-reorder)
if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
add_compile_options(-Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-unused-function)
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
add_compile_options(-Wno-trigraphs -Wno-unused-local-typedef -Wno-unknown-warning-option -Wno-shorten-64-to-32)
endif()
if (NOT GCC_DISABLE_FATAL_WARNINGS)
set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
endif (NOT GCC_DISABLE_FATAL_WARNINGS)
set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor")
CHECK_CXX_COMPILER_FLAG(-Wdeprecated-copy HAS_DEPRECATED_COPY)
if (HAS_DEPRECATED_COPY)
add_compile_options(-Wno-deprecated-copy)
endif()
set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
if (NOT DISABLE_FATAL_WARNINGS)
add_compile_options(-Werror)
endif (NOT DISABLE_FATAL_WARNINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m${ADDRESS_SIZE}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m${ADDRESS_SIZE}")
endif (LINUX OR DARWIN)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13)
add_compile_options(-Wno-unused-but-set-variable -Wno-unused-variable )
endif()
add_compile_options(-m${ADDRESS_SIZE})
endif ()
if (USESYSTEMLIBS)
add_definitions(-DLL_USESYSTEMLIBS=1)
option(RELEASE_SHOW_ASSERTS "Enable asserts in release builds" OFF)
if (LINUX AND ADDRESS_SIZE EQUAL 32)
add_definitions(-march=pentiumpro)
endif (LINUX AND ADDRESS_SIZE EQUAL 32)
if(RELEASE_SHOW_ASSERTS)
add_compile_definitions(RELEASE_SHOW_ASSERT=1)
endif()
else (USESYSTEMLIBS)
set(${ARCH}_linux_INCLUDES
ELFIO
atk-1.0
glib-2.0
gstreamer-0.10
gtk-2.0
pango-1.0
)
endif (USESYSTEMLIBS)
option(ENABLE_TIMING "Enable all fast timers" ON)
if(ENABLE_TIMING)
add_compile_definitions(AL_ENABLE_ALL_TIMERS=1)
endif()
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
if(HAVOK OR HAVOK_TPV)
add_compile_definitions(LL_HAVOK=1)
endif()
include(BerkeleyDB)
include(Linking)
include(Prebuilt)
set(APR_FIND_QUIETLY ON)
set(APR_FIND_REQUIRED ON)
include_guard()
set(APRUTIL_FIND_QUIETLY ON)
set(APRUTIL_FIND_REQUIRED ON)
add_library( ll::apr INTERFACE IMPORTED )
if (USESYSTEMLIBS)
include(FindAPR)
else (USESYSTEMLIBS)
use_prebuilt_binary(apr_suite)
if (WINDOWS)
if (LLCOMMON_LINK_SHARED)
set(APR_selector "lib")
else (LLCOMMON_LINK_SHARED)
set(APR_selector "")
endif (LLCOMMON_LINK_SHARED)
set(APR_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apr-1.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib
)
set(APRICONV_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apriconv-1.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib
)
set(APRUTIL_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
)
elseif (DARWIN)
if (LLCOMMON_LINK_SHARED)
set(APR_selector "0.dylib")
set(APRUTIL_selector "0.dylib")
else (LLCOMMON_LINK_SHARED)
set(APR_selector "a")
set(APRUTIL_selector "a")
endif (LLCOMMON_LINK_SHARED)
set(APR_LIBRARIES libapr-1.${APR_selector})
set(APRUTIL_LIBRARIES libaprutil-1.${APRUTIL_selector})
set(APRICONV_LIBRARIES iconv)
else (WINDOWS)
set(APR_LIBRARIES apr-1)
set(APRUTIL_LIBRARIES aprutil-1)
set(APRICONV_LIBRARIES iconv)
endif (WINDOWS)
set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/apr-1)
use_system_binary( apr apr-util )
use_prebuilt_binary(apr_suite)
if (LINUX)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} rt)
endif (LINUX)
endif (USESYSTEMLIBS)
if (WINDOWS)
set(APR_selector "")
target_link_libraries( ll::apr INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apr-1.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apriconv-1.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}aprutil-1.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib
)
target_compile_definitions( ll::apr INTERFACE APR_DECLARE_STATIC=1 APU_DECLARE_STATIC=1 API_DECLARE_STATIC=1)
elseif (DARWIN)
target_link_libraries( ll::apr INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a
iconv
)
else()
target_link_libraries( ll::apr INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a
rt
)
endif ()
target_include_directories( ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1 )
# -*- cmake -*-
include(Prebuilt)
use_prebuilt_binary(libatmosphere)
set(LIBATMOSPHERE_LIBRARIES atmosphere)
set(LIBATMOSPHERE_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/atmosphere)
# -*- cmake -*-
include(Linking)
include(Prebuilt)
if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(OGG REQUIRED ogg)
pkg_check_modules(VORBIS REQUIRED vorbis)
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
else (USESYSTEMLIBS)
use_prebuilt_binary(ogg_vorbis)
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
include_guard()
add_library( ll::vorbis INTERFACE IMPORTED )
if (WINDOWS)
set(OGG_LIBRARIES
optimized ogg_static
debug ogg_static_d)
set(VORBIS_LIBRARIES
optimized vorbis_static
debug vorbis_static_d)
set(VORBISENC_LIBRARIES
optimized vorbisenc_static
debug vorbisenc_static_d)
set(VORBISFILE_LIBRARIES
optimized vorbisfile_static
debug vorbisfile_static_d)
else (WINDOWS)
set(OGG_LIBRARIES ogg)
set(VORBIS_LIBRARIES vorbis)
set(VORBISENC_LIBRARIES vorbisenc)
set(VORBISFILE_LIBRARIES vorbisfile)
endif (WINDOWS)
endif (USESYSTEMLIBS)
use_system_binary(vorbis)
use_prebuilt_binary(ogg_vorbis)
target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
link_directories(
${VORBIS_LIBRARY_DIRS}
${VORBISENC_LIBRARY_DIRS}
${VORBISFILE_LIBRARY_DIRS}
${OGG_LIBRARY_DIRS}
if (WINDOWS)
target_link_libraries(ll::vorbis INTERFACE
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisfile.lib
)
else (WINDOWS)
target_link_libraries(ll::vorbis INTERFACE
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisenc.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisfile.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.a
)
endif (WINDOWS)
# -*- cmake -*-
include(Prebuilt)
set(DB_FIND_QUIETLY ON)
set(DB_FIND_REQUIRED ON)
if (USESYSTEMLIBS)
include(FindBerkeleyDB)
else (USESYSTEMLIBS)
if (LINUX)
# Need to add dependency pthread explicitely to support ld.gold.
use_prebuilt_binary(db)
set(DB_LIBRARIES db-5.1 pthread)
else (LINUX)
set(DB_LIBRARIES db-4.2)
endif (LINUX)
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (USESYSTEMLIBS)
# -*- cmake -*-
include(Prebuilt)
set(Boost_FIND_QUIETLY ON)
set(Boost_FIND_REQUIRED ON)
include_guard()
if (USESYSTEMLIBS)
include(FindBoost)
add_library( ll::boost INTERFACE IMPORTED )
if( USE_CONAN )
target_link_libraries( ll::boost INTERFACE CONAN_PKG::boost )
target_compile_definitions( ll::boost INTERFACE BOOST_ALLOW_DEPRECATED_HEADERS BOOST_BIND_GLOBAL_PLACEHOLDERS )
return()
endif()
set(BOOST_CONTEXT_LIBRARY boost_context-mt)
set(BOOST_COROUTINE_LIBRARY boost_coroutine-mt)
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
set(BOOST_REGEX_LIBRARY boost_regex-mt)
set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
set(BOOST_THREAD_LIBRARY boost_thread-mt)
else (USESYSTEMLIBS)
use_prebuilt_binary(boost)
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(BOOST_VERSION "1.55")
use_prebuilt_binary(boost)
if (WINDOWS)
if(MSVC80)
# This should be obsolete at this point
set(BOOST_CONTEXT_LIBRARY
optimized libboost_context-vc80-mt-${BOOST_VERSION}
debug libboost_context-vc80-mt-gd-${BOOST_VERSION})
set(BOOST_FILESYSTEM_LIBRARY
optimized libboost_filesystem-vc80-mt-${BOOST_VERSION}
debug libboost_filesystem-vc80-mt-gd-${BOOST_VERSION})
set(BOOST_PROGRAM_OPTIONS_LIBRARY
optimized libboost_program_options-vc80-mt-${BOOST_VERSION}
debug libboost_program_options-vc80-mt-gd-${BOOST_VERSION})
set(BOOST_REGEX_LIBRARY
optimized libboost_regex-vc80-mt-${BOOST_VERSION}
debug libboost_regex-vc80-mt-gd-${BOOST_VERSION})
set(BOOST_SIGNALS_LIBRARY
optimized libboost_signals-vc80-mt-${BOOST_VERSION}
debug libboost_signals-vc80-mt-gd-${BOOST_VERSION})
set(BOOST_SYSTEM_LIBRARY
optimized libboost_system-vc80-mt-${BOOST_VERSION}
debug libboost_system-vc80-mt-gd-${BOOST_VERSION})
set(BOOST_THREAD_LIBRARY
optimized libboost_thread-vc80-mt-${BOOST_VERSION}
debug libboost_thread-vc80-mt-gd-${BOOST_VERSION})
else(MSVC80)
# MSVC 10.0 config
set(BOOST_CONTEXT_LIBRARY
optimized libboost_context-mt
debug libboost_context-mt-gd)
set(BOOST_COROUTINE_LIBRARY
optimized libboost_coroutine-mt
debug libboost_coroutine-mt-gd)
set(BOOST_FILESYSTEM_LIBRARY
optimized libboost_filesystem-mt
debug libboost_filesystem-mt-gd)
set(BOOST_PROGRAM_OPTIONS_LIBRARY
optimized libboost_program_options-mt
debug libboost_program_options-mt-gd)
set(BOOST_REGEX_LIBRARY
optimized libboost_regex-mt
debug libboost_regex-mt-gd)
set(BOOST_SIGNALS_LIBRARY
optimized libboost_signals-mt
debug libboost_signals-mt-gd)
set(BOOST_SYSTEM_LIBRARY
optimized libboost_system-mt
debug libboost_system-mt-gd)
set(BOOST_THREAD_LIBRARY
optimized libboost_thread-mt
debug libboost_thread-mt-gd)
endif (MSVC80)
elseif (LINUX)
set(BOOST_CONTEXT_LIBRARY
optimized boost_context-mt
debug boost_context-mt-d)
set(BOOST_COROUTINE_LIBRARY
optimized boost_coroutine-mt
debug boost_coroutine-mt-d)
set(BOOST_FILESYSTEM_LIBRARY
optimized boost_filesystem-mt
debug boost_filesystem-mt-d)
set(BOOST_PROGRAM_OPTIONS_LIBRARY
optimized boost_program_options-mt
debug boost_program_options-mt-d)
set(BOOST_REGEX_LIBRARY
optimized boost_regex-mt
debug boost_regex-mt-d)
set(BOOST_SIGNALS_LIBRARY
optimized boost_signals-mt
debug boost_signals-mt-d)
set(BOOST_SYSTEM_LIBRARY
optimized boost_system-mt
debug boost_system-mt-d)
set(BOOST_THREAD_LIBRARY
optimized boost_thread-mt
debug boost_thread-mt-d)
elseif (DARWIN)
set(BOOST_CONTEXT_LIBRARY
# As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed
# with the address size.
set(addrsfx "-x${ADDRESS_SIZE}")
if (WINDOWS)
target_link_libraries( ll::boost INTERFACE
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_context-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_context-mt-gd${addrsfx}.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_fiber-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_fiber-mt-gd${addrsfx}.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_filesystem-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_filesystem-mt-gd${addrsfx}.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_program_options-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_program_options-mt-gd${addrsfx}.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_regex-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_regex-mt-gd${addrsfx}.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_stacktrace_windbg-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_stacktrace_windbg-mt-gd${addrsfx}.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_system-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_system-mt-gd${addrsfx}.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_thread-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_thread-mt-gd${addrsfx}.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_wave-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_wave-mt-gd${addrsfx}.lib
)
elseif (LINUX)
target_link_libraries( ll::boost INTERFACE
${ARCH_PREBUILT_DIRS}/libboost_fiber-mt${addrsfx}.a
${ARCH_PREBUILT_DIRS}/libboost_context-mt${addrsfx}.a
${ARCH_PREBUILT_DIRS}/libboost_filesystem-mt${addrsfx}.a
${ARCH_PREBUILT_DIRS}/libboost_program_options-mt${addrsfx}.a
${ARCH_PREBUILT_DIRS}/libboost_regex-mt${addrsfx}.a
${ARCH_PREBUILT_DIRS}/libboost_thread-mt${addrsfx}.a
${ARCH_PREBUILT_DIRS}/libboost_wave-mt${addrsfx}.a
${ARCH_PREBUILT_DIRS}/libboost_system-mt${addrsfx}.a
rt
)
elseif (DARWIN)
target_link_libraries( ll::boost INTERFACE
optimized boost_context-mt
debug boost_context-mt-d)
set(BOOST_COROUTINE_LIBRARY
optimized boost_coroutine-mt
debug boost_coroutine-mt-d)
set(BOOST_FILESYSTEM_LIBRARY
debug boost_context-mt-d
optimized boost_fiber-mt
debug boost_fiber-mt-d
optimized boost_filesystem-mt
debug boost_filesystem-mt-d)
set(BOOST_PROGRAM_OPTIONS_LIBRARY
debug boost_filesystem-mt-d
optimized boost_program_options-mt
debug boost_program_options-mt-d)
set(BOOST_REGEX_LIBRARY
debug boost_program_options-mt-d
optimized boost_regex-mt
debug boost_regex-mt-d)
set(BOOST_SIGNALS_LIBRARY
optimized boost_signals-mt
debug boost_signals-mt-d)
set(BOOST_SYSTEM_LIBRARY
debug boost_regex-mt-d
optimized boost_system-mt
debug boost_system-mt-d)
set(BOOST_THREAD_LIBRARY
debug boost_system-mt-d
optimized boost_thread-mt
debug boost_thread-mt-d)
endif (WINDOWS)
endif (USESYSTEMLIBS)
if (LINUX)
set(BOOST_SYSTEM_LIBRARY ${BOOST_SYSTEM_LIBRARY} rt)
set(BOOST_THREAD_LIBRARY ${BOOST_THREAD_LIBRARY} rt)
endif (LINUX)
debug boost_thread-mt-d
optimized boost_wave-mt
debug boost_wave-mt-d
)
endif (WINDOWS)
target_compile_definitions( ll::boost INTERFACE BOOST_ALLOW_DEPRECATED_HEADERS=1 BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE=1 BOOST_BIND_GLOBAL_PLACEHOLDERS=1)
# -*- cmake -*-
# Construct the version and copyright information based on package data.
include(Python)
include(FindAutobuild)
include_guard()
# packages-formatter.py runs autobuild install --versions, which needs to know
# the build_directory, which (on Windows) depends on AUTOBUILD_ADDRSIZE.
......@@ -12,8 +14,8 @@ add_custom_command(OUTPUT packages-info.txt
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml
DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py
${CMAKE_SOURCE_DIR}/../autobuild.xml
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE}
${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > packages-info.txt
COMMAND ${Python3_EXECUTABLE}
${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE} -DAUTOBUILD=${AUTOBUILD_EXECUTABLE}
${Python3_EXECUTABLE}
${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" "${LIBS_PREBUILT_DIR}" > packages-info.txt
)
This diff is collapsed.
......@@ -2,21 +2,17 @@
include(Linking)
include(Prebuilt)
if (USESYSTEMLIBS)
set(CEFPLUGIN OFF CACHE BOOL
"CEFPLUGIN support for the llplugin/llmedia test apps.")
else (USESYSTEMLIBS)
use_prebuilt_binary(dullahan)
set(CEFPLUGIN ON CACHE BOOL
"CEFPLUGIN support for the llplugin/llmedia test apps.")
set(CEF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/cef)
endif (USESYSTEMLIBS)
include_guard()
add_library( ll::cef INTERFACE IMPORTED )
use_prebuilt_binary(dullahan)
target_include_directories( ll::cef SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/cef)
if (WINDOWS)
set(CEF_PLUGIN_LIBRARIES
libcef.lib
libcef_dll_wrapper.lib
dullahan.lib
target_link_libraries( ll::cef INTERFACE
${ARCH_PREBUILT_DIRS_RELEASE}/libcef.lib
${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.lib
${ARCH_PREBUILT_DIRS_RELEASE}/dullahan.lib
)
elseif (DARWIN)
FIND_LIBRARY(APPKIT_LIBRARY AppKit)
......@@ -24,17 +20,16 @@ elseif (DARWIN)
message(FATAL_ERROR "AppKit not found")
endif()
FIND_LIBRARY(CEF_LIBRARY "Chromium Embedded Framework" ${ARCH_PREBUILT_DIRS_RELEASE})
if (NOT CEF_LIBRARY)
message(FATAL_ERROR "CEF not found")
endif()
set(CEF_PLUGIN_LIBRARIES
target_link_libraries( ll::cef INTERFACE
${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a
${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a
${APPKIT_LIBRARY}
${CEF_LIBRARY}
)
elseif (LINUX)
target_link_libraries( ll::cef INTERFACE
dullahan
cef
cef_dll_wrapper.a
)
endif (WINDOWS)
......@@ -10,20 +10,20 @@
MACRO(COPY_IF_DIFFERENT FROM_DIR TO_DIR TARGETS)
# Macro to implement copy_if_different for a list of files
# Arguments -
# Arguments -
# FROM_DIR - this is the source directory
# TO_DIR - this is the destination directory
# TARGETS - A variable to receive a list of targets
# FILES - names of the files to copy
# TODO: add globing.
# FILES - names of the files to copy
# TODO: add globing.
SET(AddTargets "")
FOREACH(SRC ${ARGN})
GET_FILENAME_COMPONENT(SRCFILE ${SRC} NAME)
GET_FILENAME_COMPONENT(SRCFILE ${SRC} NAME)
IF("${FROM_DIR}" STREQUAL "")
SET(FROM ${SRC})
ELSE("${FROM_DIR}" STREQUAL "")
SET(FROM ${FROM_DIR}/${SRC})
ENDIF("${FROM_DIR}" STREQUAL "")
ENDIF("${FROM_DIR}" STREQUAL "")
IF("${TO_DIR}" STREQUAL "")
SET(TO ${SRCFILE})
ELSE("${TO_DIR}" STREQUAL "")
......
This diff is collapsed.
# -*- cmake -*-
include(Prebuilt)
include(Linking)
set(CURL_FIND_QUIETLY ON)
set(CURL_FIND_REQUIRED ON)
include_guard()
add_library( ll::libcurl INTERFACE IMPORTED )
if (USESYSTEMLIBS)
include(FindCURL)
else (USESYSTEMLIBS)
use_prebuilt_binary(curl)
if (WINDOWS)
set(CURL_LIBRARIES
debug libcurld.lib
optimized libcurl.lib)
else (WINDOWS)
set(CURL_LIBRARIES libcurl.a)
endif (WINDOWS)
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (USESYSTEMLIBS)
use_system_binary(libcurl)
use_prebuilt_binary(curl)
if (WINDOWS)
target_link_libraries(ll::libcurl INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcurld.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.lib
ll::openssl
ll::nghttp2
ll::zlib-ng
Normaliz.lib
Iphlpapi.lib
)
target_compile_definitions( ll::libcurl INTERFACE CURL_STATICLIB=1)
elseif(DARWIN)
target_link_libraries(ll::libcurl INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libcurld.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.a
ll::openssl
ll::nghttp2
ll::zlib-ng
resolv
)
else ()
target_link_libraries(ll::libcurl INTERFACE
${ARCH_PREBUILT_DIRS}/libcurl.a
ll::openssl
ll::nghttp2
ll::zlib-ng
)
endif ()
target_include_directories( ll::libcurl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)