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 1319 additions and 479 deletions
#!/usr/bin/env bash
# This is the custom build script for the viewer
#
# It must be run by the Linden Lab build farm shared buildscript because
# it relies on the environment that sets up, functions it provides, and
# the build result post-processing it does.
#
# PLEASE NOTE:
#
# * This script is interpreted on three platforms, including windows and cygwin
# Cygwin can be tricky....
# * The special style in which python is invoked is intentional to permit
# use of a native python install on windows - which requires paths in DOS form
cleanup="true"
retry_cmd()
{
max_attempts="$1"; shift
initial_wait="$1"; shift
attempt_num=1
echo "trying" "$@"
until "$@"
do
if ((attempt_num==max_attempts))
then
echo "Last attempt $attempt_num failed"
return 1
else
wait_time=$(($attempt_num*$initial_wait))
echo "Attempt $attempt_num failed. Trying again in $wait_time seconds..."
sleep $wait_time
attempt_num=$(($attempt_num+1))
fi
done
echo "succeeded"
return 0
}
build_dir_Darwin()
{
echo build-darwin-x86_64
}
build_dir_Linux()
{
echo build-linux-i686
}
build_dir_CYGWIN()
{
echo build-vc${AUTOBUILD_VSVER:-120}-${AUTOBUILD_ADDRSIZE}
}
viewer_channel_suffix()
{
local package_name="$1"
local suffix_var="${package_name}_viewer_channel_suffix"
local suffix=$(eval "echo \$${suffix_var}")
if [ "$suffix"x = ""x ]
then
echo ""
else
echo "_$suffix"
fi
}
installer_Darwin()
{
local package_name="$1"
local package_dir="$(build_dir_Darwin)/newview/"
local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_x86_64\\.dmg\$"
# since the additional packages are built after the base package,
# sorting oldest first ensures that the unqualified package is returned
# even if someone makes a qualified name that duplicates the last word of the base name
local package=$(ls -1tr "$package_dir" 2>/dev/null | grep -E "$pattern" | head -n 1)
test "$package"x != ""x && echo "$package_dir/$package"
}
installer_Linux()
{
local package_name="$1"
local package_dir="$(build_dir_Linux)/newview/"
local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_i686\\.tar\\.xz\$"
# since the additional packages are built after the base package,
# sorting oldest first ensures that the unqualified package is returned
# even if someone makes a qualified name that duplicates the last word of the base name
package=$(ls -1tr "$package_dir" 2>/dev/null | grep -E "$pattern" | head -n 1)
test "$package"x != ""x && echo "$package_dir/$package"
}
installer_CYGWIN()
{
local package_name="$1"
local variant=${last_built_variant:-Release}
local build_dir=$(build_dir_CYGWIN ${variant})
local package_dir
if [ "$package_name"x = ""x ]
then
package_dir="${build_dir}/newview/${variant}"
else
package_dir="${build_dir}/newview/${package_name}/${variant}"
fi
if [ -r "${package_dir}/touched.bat" ]
then
local package_file=$(sed 's:.*=::' "${package_dir}/touched.bat")
echo "${package_dir}/${package_file}"
fi
}
# if someone wants to run build.sh outside the GitHub environment
[[ -n "$GITHUB_OUTPUT" ]] || export GITHUB_OUTPUT='/dev/null'
# The following is based on the Warning for GitHub multiline output strings:
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
# Build up these arrays as we go
metadata=()
symbolfile=()
physicstpv=()
# and dump them to GITHUB_OUTPUT when done
cleanup="$cleanup ; \
arrayoutput metadata ; \
arrayoutput symbolfile ; \
arrayoutput physicstpv"
trap "$cleanup" EXIT
arrayoutput()
{
local outputname="$1"
# append "[*]" to the array name so array indirection works
local array="$1[*]"
local IFS='
'
echo "$outputname<<$EOF
${!array}
$EOF" >> "$GITHUB_OUTPUT"
}
pre_build()
{
local variant="$1"
begin_section "Configure $variant"
[ -n "$master_message_template_checkout" ] \
&& [ -r "$master_message_template_checkout/message_template.msg" ] \
&& template_verifier_master_url="-DTEMPLATE_VERIFIER_MASTER_URL=file://$master_message_template_checkout/message_template.msg"
RELEASE_CRASH_REPORTING=ON
HAVOK=ON
SIGNING=()
if [[ "$arch" == "Darwin" && "$variant" == "Release" ]]
then SIGNING=("-DENABLE_SIGNING:BOOL=YES" \
"-DSIGNING_IDENTITY:STRING=Developer ID Application: Linden Research, Inc.")
fi
if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ]
then
case "$arch" in
CYGWIN)
symplat="windows"
;;
Darwin)
symplat="darwin"
;;
Linux)
symplat="linux"
;;
esac
# This name is consumed by indra/newview/CMakeLists.txt. Make it
# absolute because we've had troubles with relative pathnames.
abs_build_dir="$(cd "$build_dir"; pwd)"
VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/symbols/$variant/${viewer_channel}.sym.tar.xz")"
fi
# honor autobuild_configure_parameters same as sling-buildscripts
eval_autobuild_configure_parameters=$(eval $(echo echo $autobuild_configure_parameters))
"$autobuild" configure --quiet -c $variant \
${eval_autobuild_configure_parameters:---} \
-DLL_TESTS:BOOL=ON \
-DPACKAGE:BOOL=ON \
-DHAVOK:BOOL="$HAVOK" \
-DRELEASE_CRASH_REPORTING:BOOL="$RELEASE_CRASH_REPORTING" \
-DVIEWER_SYMBOL_FILE:STRING="${VIEWER_SYMBOL_FILE:-}" \
-DBUGSPLAT_DB:STRING="${BUGSPLAT_DB:-}" \
-DVIEWER_CHANNEL:STRING="${viewer_channel}" \
-DGRID:STRING="\"$viewer_grid\"" \
-DTEMPLATE_VERIFIER_OPTIONS:STRING="$template_verifier_options" $template_verifier_master_url \
"${SIGNING[@]}" \
|| fatal "$variant configuration failed"
end_section "Configure $variant"
}
package_llphysicsextensions_tpv()
{
begin_section "PhysicsExtensions_TPV"
tpv_status=0
# nat 2016-12-21: without HAVOK, can't build PhysicsExtensions_TPV.
if [ "$variant" = "Release" -a "${HAVOK:-}" != "OFF" ]
then
tpvconfig="$build_dir/packages/llphysicsextensions/autobuild-tpv.xml"
test -r "$tpvconfig" || fatal "No llphysicsextensions_tpv autobuild configuration found"
# SL-19942: autobuild ignores -c switch if AUTOBUILD_CONFIGURATION set
unset AUTOBUILD_CONFIGURATION
"$autobuild" build --quiet --config-file "$(native_path "$tpvconfig")" -c Tpv \
|| fatal "failed to build llphysicsextensions_tpv"
# capture the package file name for use in upload later...
PKGTMP=`mktemp -t pgktpv.XXXXXX`
cleanup="$cleanup ; rm $PKGTMP* 2>/dev/null"
trap "$cleanup" EXIT
"$autobuild" package --quiet --config-file "$tpvconfig" --results-file "$(native_path $PKGTMP)" || fatal "failed to package llphysicsextensions_tpv"
tpv_status=$?
if [ -r "${PKGTMP}" ]
then
. "${PKGTMP}" # sets autobuild_package_{name,filename,md5}
echo "${autobuild_package_filename}" > $build_dir/llphysicsextensions_package
fi
else
record_event "Do not provide llphysicsextensions_tpv for $variant"
llphysicsextensions_package=""
fi
end_section "PhysicsExtensions_TPV"
return $tpv_status
}
build()
{
local variant="$1"
if $build_viewer
then
begin_section "autobuild $variant"
# honor autobuild_build_parameters same as sling-buildscripts
eval_autobuild_build_parameters=$(eval $(echo echo $autobuild_build_parameters))
"$autobuild" build --no-configure -c $variant \
$eval_autobuild_build_parameters \
|| fatal "failed building $variant"
echo true >"$build_dir"/build_ok
end_section "autobuild $variant"
begin_section "extensions $variant"
# Run build extensions
if [ -d ${build_dir}/packages/build-extensions ]
then
for extension in ${build_dir}/packages/build-extensions/*.sh
do
begin_section "Extension $extension"
. $extension
end_section "Extension $extension"
done
fi
# *TODO: Make this a build extension.
package_llphysicsextensions_tpv || fatal "failed building llphysicsextensions packages"
end_section "extensions $variant"
else
record_event "Skipping build due to configuration build_viewer=${build_viewer}"
echo true >"$build_dir"/build_ok
fi
}
################################################################
# Start of the actual script
################################################################
# Check to see if we were invoked from the master buildscripts wrapper, if not, fail
if [ "x${BUILDSCRIPTS_SUPPORT_FUNCTIONS}" = x ]
then
echo "This script relies on being run by the master Linden Lab buildscripts" 1>&2
exit 1
fi
shopt -s nullglob # if nothing matches a glob, expand to nothing
initialize_build # provided by master buildscripts build.sh
begin_section "autobuild initialize"
# ensure AUTOBUILD is in native path form for child processes
AUTOBUILD="$(native_path "$AUTOBUILD")"
# set "$autobuild" to cygwin path form for use locally in this script
autobuild="$(shell_path "$AUTOBUILD")"
if [ ! -x "$autobuild" ]
then
record_failure "AUTOBUILD not executable: '$autobuild'"
exit 1
fi
# load autobuild provided shell functions and variables
"$autobuild" --quiet source_environment > "$build_log_dir/source_environment"
PYTHONPATH="$BUILDSCRIPTS_SHARED/packages/lib/python:$PYTHONPATH"
begin_section "dump source environment commands"
cat "$build_log_dir/source_environment"
end_section "dump source environment commands"
begin_section "execute source environment commands"
. "$build_log_dir/source_environment"
end_section "execute source environment commands"
end_section "autobuild initialize"
# something about the additional_packages mechanism messes up buildscripts results.py on Linux
# since we don't care about those packages on Linux, just zero it out, yes - a HACK
if [ "$arch" = "Linux" ]
then
export additional_packages=
fi
begin_section "select viewer channel"
# Look for a branch-specific viewer_channel setting
# changeset_branch is set in the sling-buildscripts
viewer_build_branch=$(echo -n "${changeset_branch:-$(repo_branch ${BUILDSCRIPTS_SRC:-$(pwd)})}" | tr -Cs 'A-Za-z0-9_' '_' | sed -E 's/^_+//; s/_+$//')
if [ -n "$viewer_build_branch" ]
then
branch_viewer_channel_var="${viewer_build_branch}_viewer_channel"
if [ -n "${!branch_viewer_channel_var}" ]
then
viewer_channel="${!branch_viewer_channel_var}"
record_event "Overriding viewer_channel for branch '$changeset_branch' to '$viewer_channel'"
else
record_event "No branch-specific viewer_channel for branch '$viewer_build_branch'; to set a branch build channel set '$branch_viewer_channel_var'"
fi
fi
end_section "select viewer channel"
python_cmd "$helpers/codeticket.py" addinput "Viewer Channel" "${viewer_channel}"
initialize_version # provided by buildscripts build.sh; sets version id
begin_section "coding policy check"
# On our TC Windows build hosts, the GitPython library underlying our
# coding_policy_git.py script fails to run git for reasons we have not tried
# to diagnose. Clearly git works fine on those hosts, or we would never get
# this far. Running coding policy checks on one platform *should* suffice...
if [[ "$arch" == "Darwin" ]]
then
git_hooks_reqs="$git_hooks_checkout/requirements.txt"
if [[ -r "$(shell_path "$git_hooks_reqs")" ]]
then
# install the git-hooks dependencies
pip install -r "$(native_path "$git_hooks_reqs")" || \
fatal "pip install git-hooks failed"
fi
git_hooks_script="$git_hooks_checkout/coding_policy_git.py"
if [[ -r "$(shell_path "$git_hooks_script")" ]]
then
# validate the branch we're about to build
python_cmd "$(native_path "$git_hooks_script")" --all_files || \
fatal "coding policy check failed"
fi
fi
end_section "coding policy check"
# Now run the build
succeeded=true
last_built_variant=
for variant in $variants
do
# Only the last built arch is available for upload
last_built_variant="$variant"
build_dir=`build_dir_$arch $variant`
begin_section "Initialize $variant Build Directory"
rm -rf "$build_dir"
mkdir -p "$build_dir/tmp"
end_section "Initialize $variant Build Directory"
if pre_build "$variant" "$build_dir"
then
begin_section "Build $variant"
build "$variant" "$build_dir"
end_section "Build $variant"
begin_section "post-build $variant"
if `cat "$build_dir/build_ok"`
then
case "$variant" in
Release)
if [ -r "$build_dir/autobuild-package.xml" ]
then
begin_section "Autobuild metadata"
python_cmd "$helpers/codeticket.py" addoutput "Autobuild Metadata" "$build_dir/autobuild-package.xml" --mimetype text/xml \
|| fatal "Upload of autobuild metadata failed"
metadata+=("$build_dir/autobuild-package.xml")
if [ "$arch" != "Linux" ]
then
record_dependencies_graph "$build_dir/autobuild-package.xml" # defined in buildscripts/hg/bin/build.sh
else
record_event "TBD - no dependency graph for linux (probable python version dependency)"
fi
end_section "Autobuild metadata"
else
record_event "no autobuild metadata at '$build_dir/autobuild-package.xml'"
fi
if [ -r "$build_dir/newview/viewer_version.txt" ]
then
begin_section "Viewer Version"
viewer_version="$(<"$build_dir/newview/viewer_version.txt")"
python_cmd "$helpers/codeticket.py" addoutput "Viewer Version" "$viewer_version" --mimetype inline-text \
|| fatal "Upload of viewer version failed"
metadata+=("$build_dir/newview/viewer_version.txt")
echo "viewer_version=$viewer_version" >> "$GITHUB_OUTPUT"
end_section "Viewer Version"
fi
;;
Doxygen)
if [ -r "$build_dir/doxygen_warnings.log" ]
then
record_event "Doxygen warnings generated; see doxygen_warnings.log"
python_cmd "$helpers/codeticket.py" addoutput "Doxygen Log" "$build_dir/doxygen_warnings.log" --mimetype text/plain ## TBD
metadata+=("$build_dir/doxygen_warnings.log")
fi
if [ -d "$build_dir/doxygen/html" ]
then
tar -cJf "$build_dir/viewer-doxygen.tar.xz" --strip-components 3 "$build_dir/doxygen/html"
python_cmd "$helpers/codeticket.py" addoutput "Doxygen Tarball" "$build_dir/viewer-doxygen.tar.xz" \
|| fatal "Upload of doxygen tarball failed"
metadata+=("$build_dir/viewer-doxygen.tar.xz")
fi
;;
*)
;;
esac
else
record_failure "Build of \"$variant\" failed."
fi
end_section "post-build $variant"
else
record_event "configure for $variant failed: build skipped"
fi
if ! $succeeded
then
record_event "remaining variants skipped due to $variant failure"
break
fi
done
# build debian package
if [ "$arch" == "Linux" ]
then
if $succeeded
then
if $build_viewer_deb && [ "$last_built_variant" == "Release" ]
then
begin_section "Build Viewer Debian Package"
# mangle the changelog
dch --force-bad-version \
--distribution unstable \
--newversion "${VIEWER_VERSION}" \
"Automated build #$build_id, repository $branch revision $revision."
# build the debian package
$pkg_default_debuild_command || record_failure "\"$pkg_default_debuild_command\" failed."
# Unmangle the changelog file
hg revert debian/changelog
end_section "Build Viewer Debian Package"
# Run debian extensions
if [ -d ${build_dir}/packages/debian-extensions ]; then
for extension in ${build_dir}/packages/debian-extensions/*.sh; do
. $extension
done
fi
# Move any .deb results.
mkdir -p ../packages_public
mkdir -p ../packages_private
mv ${build_dir}/packages/*.deb ../packages_public 2>/dev/null || true
mv ${build_dir}/packages/packages_private/*.deb ../packages_private 2>/dev/null || true
# upload debian package and create repository
begin_section "Upload Debian Repository"
for deb_file in `/bin/ls ../packages_public/*.deb ../*.deb 2>/dev/null`; do
deb_pkg=$(basename "$deb_file" | sed 's,_.*,,')
python_cmd "$helpers/codeticket.py" addoutput "Debian $deb_pkg" $deb_file \
|| fatal "Upload of debian $deb_pkg failed"
done
for deb_file in `/bin/ls ../packages_private/*.deb 2>/dev/null`; do
deb_pkg=$(basename "$deb_file" | sed 's,_.*,,')
python_cmd "$helpers/codeticket.py" addoutput "Debian $deb_pkg" "$deb_file" --private \
|| fatal "Upload of debian $deb_pkg failed"
done
create_deb_repo
# Rename the local debian_repo* directories so that the master buildscript
# doesn't make a remote repo again.
for debian_repo_type in debian_repo debian_repo_private; do
if [ -d "$build_log_dir/$debian_repo_type" ]; then
mv $build_log_dir/$debian_repo_type $build_log_dir/${debian_repo_type}_pushed
fi
done
end_section "Upload Debian Repository"
else
record_event "debian build not enabled"
fi
else
record_event "skipping debian build due to failed build"
fi
fi
# Some of the uploads takes a long time to finish in the codeticket backend,
# causing the next codeticket upload attempt to fail.
# Inserting this after each potentially large upload may prevent those errors.
# JJ is making changes to Codeticket that we hope will eliminate this failure, then this can be removed
wait_for_codeticket()
{
sleep $(( 60 * 6 ))
}
# check status and upload results to S3
if $succeeded
then
if $build_viewer
then
begin_section "Uploads"
# nat 2016-12-22: without RELEASE_CRASH_REPORTING, we have no symbol file.
if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ]
then
# e.g. build-darwin-x86_64/symbols/Release/Second Life Test.xarchive.zip
symbol_file="${build_dir}/symbols/${variant}/${viewer_channel}.xcarchive.zip"
if [[ ! -f "$symbol_file" ]]
then
# symbol tarball we prep for (e.g.) Breakpad
symbol_file="$VIEWER_SYMBOL_FILE"
fi
# Upload crash reporter file
symbolfile+=("$symbol_file")
fi
# Upload the llphysicsextensions_tpv package, if one was produced
# Only upload this package when building the private repo so the
# artifact is private.
if [[ "x$GITHUB_REPOSITORY" == "xsecondlife/viewer-private" && \
-r "$build_dir/llphysicsextensions_package" ]]
then
llphysicsextensions_package=$(cat $build_dir/llphysicsextensions_package)
physicstpv+=("$llphysicsextensions_package")
fi
end_section "Uploads"
else
record_event "skipping upload of installer"
fi
else
record_event "skipping upload of installer due to failed build"
fi
# The branch independent build.sh script invoking this script will finish processing
$succeeded || exit 1
# standalone functions from sling-buildscripts
set_build_number_to_revision()
{
record_event "buildNumber $revision"
}
record_event()
{
echo "=== $@"
}
begin_section()
{
record_event "START $*"
sections+=("$*")
}
end_section()
{
# accommodate dumb Mac bash 3, which doesn't understand array[-1]
local last=$(( ${#sections[@]} - 1 ))
record_event "END ${*:-${sections[$last]}}"
unset "sections[$last]"
}
record_success()
{
record_event "SUCCESS $*"
}
record_failure()
{
record_event "FAILURE $*" >&2
}
fatal()
{
record_failure "$@"
finalize false
exit 1
}
# redefined fail for backward compatibility
alias fail=fatal
pass()
{
exit 0
}
export -f set_build_number_to_revision
export -f record_event
export -f begin_section
export -f end_section
export -f record_success
export -f record_failure
export -f fatal
export -f pass
export sections
......@@ -19,6 +19,7 @@ Agathos Frascati
CT-317
CT-352
Ai Austin
SL-19399
Aiko Ying
Aimee Trescothick
SNOW-227
......@@ -63,6 +64,8 @@ Aimee Trescothick
VWR-14711
VWR-14712
VWR-15454
AiraYumi
SL-20781 (github PR #613)
Alejandro Rosenthal
VWR-1184
Aleric Inglewood
......@@ -237,6 +240,13 @@ Ansariel Hiller
SL-15227
SL-15398
SL-18432
SL-19140
SL-19575
SL-19623
SL-4126
SL-20224
SL-20524
secondlife/viewer#1051
Aralara Rajal
Arare Chantilly
CHUIBUG-191
......@@ -282,8 +292,13 @@ Beq Janus
SL-11300
SL-15709
SL-16021
SL-18202
SL-18586
SL-18592
SL-18637
SL-19317
SL-19660
SL-20610
Beth Walcher
Bezilon Kasei
Biancaluce Robbiani
......@@ -375,6 +390,7 @@ Chaser Zaks
BUG-225599
BUG-227485
SL-16874
SL-20442
Cherry Cheevers
ChickyBabes Zuzu
Chorazin Allen
......@@ -492,6 +508,8 @@ Evangelista Emerald
Faelon Swordthain
Farallon Greyskin
VWR-2036
Fawrsk
SL-18893
Feep Larsson
VWR-447
VWR-1314
......@@ -584,6 +602,10 @@ Henri Beauchamp
VWR-1320
VWR-1406
VWR-4157
SL-15175
SL-19110
SL-19159
[NO JIRA] (fullbright HUD alpha fix)
herina Bode
Hikkoshi Sakai
VWR-429
......@@ -830,6 +852,7 @@ Kadah Coba
Jondan Lundquist
Joosten Briebers
MAINT-7074
BUG-225288
Josef Munster
Josette Windlow
Juilan Tripsa
......@@ -884,6 +907,8 @@ Kitty Barnett
STORM-2149
MAINT-7581
MAINT-7081
DRTVWR-489 (Internal JIRA that tracks Kitty's sizeable, epic contribution: support for Emoji characters in the Viewer [April 2023])
SL-18988
Kolor Fall
Komiko Okamoto
Korvel Noh
......@@ -915,6 +940,8 @@ LSL Scientist
Lamorna Proctor
Lares Carter
Larry Pixel
Lars Næsbye Christensen
SL-20054
Laurent Bechir
Leal Choche
Lenae Munz
......@@ -922,6 +949,8 @@ Lexi Frua
Lillie Cordeaux
Lilly Zenovka
Lizzy Macarthur
Logue Takacs
INTL-490
Luban Yiyuan
Luc Starsider
Luminous Luminos
......@@ -1127,6 +1156,7 @@ Nicky Dasmijn
SL-14541
SL-16438
SL-17218
SL-17238
SL-17585
Nicky Perian
OPEN-1
......@@ -1173,6 +1203,12 @@ Ollie Kubrick
Orenj Marat
Orion Delphis
Oryx Tempel
PanteraPolnocy
SL-18891
SL-18904
SL-18937
SL-19207
SL-19681
Parvati Silverweb
Patric Mills
VWR-2645
......@@ -1397,6 +1433,8 @@ Sovereign Engineer
SL-18497
SL-18525
SL-18534
SL-19690
SL-19336
SpacedOut Frye
VWR-34
VWR-45
......
These are the generous donors to the Alchemy project and other opensource developers that help develop this metaverse.
Sorry if I've missed anyone just ping me on discord!
A Raven
Adrint
Amerille Starling
Anarcho Rodentia Autonomous Zone
Axirala
Bellimora Bunny
Farlado UwU
Idoru Kiyori
gwigz
Heather Laughton
Idoru Venus
Johnny Ming
JP Beach
Katie Suki
Lance McKenath
Lemon
Logue Takacs
Makay Scribe
Michelle Dakota
Moolly Parton
MutexCat
Nia
Nikolina Evergarden
PygBag
Rhea Mercury
Sandy Burgess
Sonador Blackwood
Sonny
Spiffy Voxel
Strobus Spore
Todd Lygon
Tyler C
WurdNerd
ZoZo Raven
Kitty Barnett
Amethyst
......
The Setting RenderMaxTextureResolution controls the maximum resolution of non-boosted textures as displayed by the viewer.
Valid values are 512-2048 (clamped in C++).
![image](https://github.com/secondlife/viewer/assets/23218274/d0f889fc-8135-41d2-9d83-871ad4eebed5)
![image](https://github.com/secondlife/viewer/assets/23218274/19950828-7eb1-4bb2-85d7-f35c63b34294)
![image](https://github.com/secondlife/viewer/assets/23218274/249afc83-4de6-488d-a05e-4877d08573b1)
Test Asset available on beta grid:
Object: 'Damaged Helmet', AssetID 0623e759-11b5-746c-a75e-7ba1caa6eb0e
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>
......
......@@ -3,29 +3,71 @@
# cmake_minimum_required should appear before any
# other commands to guarantee full compatibility
# with the version specified
cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR)
cmake_policy(SET CMP0063 NEW)
## 3.8 added VS_DEBUGGER_WORKING_DIRECTORY support
## 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")
set(CMAKE_C_STANDARD 11)
# 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)
set_property(GLOBAL PROPERTY USE_FOLDERS 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)
......@@ -47,6 +89,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llmessage)
add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive)
add_subdirectory(${LIBS_OPEN_PREFIX}llrender)
add_subdirectory(${LIBS_OPEN_PREFIX}llfilesystem)
add_subdirectory(${LIBS_OPEN_PREFIX}llwebrtc)
add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
......@@ -60,20 +103,16 @@ 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)
# sets the 'startup project' for debugging from visual studio.
set_property(
DIRECTORY ${VIEWER_PREFIX}
PROPERTY VS_STARTUP_PROJECT alchemy-bin
)
if (USE_BUGSPLAT)
if (BUGSPLAT_DB)
message(STATUS "Building with BugSplat; database '${BUGSPLAT_DB}'")
......@@ -87,6 +126,12 @@ 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 ${VIEWER_BINARY_NAME}
)
if (LL_TESTS)
# Define after the custom targets are created so
# individual apps can add themselves as dependencies
......
This diff is collapsed.
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)
use_system_binary( apr apr-util )
use_prebuilt_binary(apr_suite)
if (WINDOWS)
set(APR_selector "")
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)
set(APR_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
)
set(APRICONV_LIBRARIES iconv)
set(APRUTIL_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a ${APRICONV_LIBRARIES}
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a ${APRICONV_LIBRARIES}
)
else()
set(APR_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
)
set(APRUTIL_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a
)
endif ()
set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/apr-1)
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
)
if (LINUX)
list(APPEND APRUTIL_LIBRARIES rt)
endif (LINUX)
endif (USESYSTEMLIBS)
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)
......@@ -2,40 +2,31 @@
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
use_system_binary(vorbis)
use_prebuilt_binary(ogg_vorbis)
target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
if (WINDOWS)
target_link_libraries(ll::vorbis INTERFACE
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.lib)
set(VORBIS_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib)
set(VORBISFILE_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisfile.lib)
else (WINDOWS)
set(OGG_LIBRARIES
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.a)
set(VORBIS_LIBRARIES
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.a)
set(VORBISENC_LIBRARIES
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)
set(VORBISFILE_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisenc.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisfile.a)
endif (WINDOWS)
endif (USESYSTEMLIBS)
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)
include(Linking)
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_FIBER_LIBRARY boost_fiber-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)
use_prebuilt_binary(boost)
# As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed
# with the address size.
set(addrsfx "-x${ADDRESS_SIZE}")
# 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)
set(BOOST_CONTEXT_LIBRARY
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)
set(BOOST_FIBER_LIBRARY
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)
set(BOOST_FILESYSTEM_LIBRARY
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)
set(BOOST_PROGRAM_OPTIONS_LIBRARY
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)
set(BOOST_REGEX_LIBRARY
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)
set(BOOST_SIGNALS_LIBRARY
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_signals-mt${addrsfx}.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libboost_signals-mt-gd${addrsfx}.lib)
set(BOOST_STACKTRACE_LIBRARY
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)
set(BOOST_SYSTEM_LIBRARY
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)
set(BOOST_THREAD_LIBRARY
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)
set(BOOST_WAVE_LIBRARY
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)
set(BOOST_CONTEXT_LIBRARY
optimized boost_context-mt${addrsfx}
debug boost_context-mt${addrsfx}-d)
set(BOOST_FIBER_LIBRARY
optimized boost_fiber-mt${addrsfx}
debug boost_fiber-mt${addrsfx}-d)
set(BOOST_FILESYSTEM_LIBRARY
optimized boost_filesystem-mt${addrsfx}
debug boost_filesystem-mt${addrsfx}-d)
set(BOOST_PROGRAM_OPTIONS_LIBRARY
optimized boost_program_options-mt${addrsfx}
debug boost_program_options-mt${addrsfx}-d)
set(BOOST_REGEX_LIBRARY
optimized boost_regex-mt${addrsfx}
debug boost_regex-mt${addrsfx}-d)
set(BOOST_SIGNALS_LIBRARY
optimized boost_signals-mt${addrsfx}
debug boost_signals-mt${addrsfx}-d)
set(BOOST_SYSTEM_LIBRARY
optimized boost_system-mt${addrsfx}
debug boost_system-mt${addrsfx}-d)
set(BOOST_THREAD_LIBRARY
optimized boost_thread-mt${addrsfx}
debug boost_thread-mt${addrsfx}-d)
set(BOOST_WAVE_LIBRARY
optimized boost_wave-mt${addrsfx}
debug boost_wave-mt${addrsfx}-d)
elseif (DARWIN)
set(BOOST_CONTEXT_LIBRARY
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_FIBER_LIBRARY
debug boost_context-mt-d
optimized boost_fiber-mt
debug boost_fiber-mt-d)
set(BOOST_FILESYSTEM_LIBRARY
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)
set(BOOST_WAVE_LIBRARY
debug boost_thread-mt-d
optimized boost_wave-mt
debug boost_wave-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_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)
......@@ -2,6 +2,8 @@
# Construct the version and copyright information based on package data.
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.
# Within an autobuild build, AUTOBUILD_ADDRSIZE is already set. But when
......@@ -15,5 +17,5 @@ add_custom_command(OUTPUT 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}" > packages-info.txt
${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" "${LIBS_PREBUILT_DIR}" > packages-info.txt
)
# -*- cmake -*-
include_guard()
option(REVISION_FROM_VCS "Get current revision from vcs" ON)
# Construct the viewer channel from environment variables or defaults
if(NOT DEFINED VIEWER_CHANNEL)
......@@ -52,20 +54,21 @@ if(NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/ne
set(VIEWER_VERSION_BASE_FILE "${CMAKE_SOURCE_DIR}/newview/VIEWER_VERSION.txt")
if(EXISTS ${VIEWER_VERSION_BASE_FILE})
file(STRINGS ${VIEWER_VERSION_BASE_FILE} VIEWER_FILE_VERSION REGEX "^[0-9]+\\.[0-9]+")
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+" "\\1" VIEWER_VERSION_MAJOR ${VIEWER_FILE_VERSION})
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)" "\\1" VIEWER_VERSION_MINOR ${VIEWER_FILE_VERSION})
file(STRINGS ${VIEWER_VERSION_BASE_FILE} VIEWER_SHORT_VERSION REGEX "^[0-9]+\\.[0-9]+\\.[0-9]+")
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VIEWER_VERSION_MAJOR ${VIEWER_SHORT_VERSION})
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" VIEWER_VERSION_MINOR ${VIEWER_SHORT_VERSION})
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" VIEWER_VERSION_PATCH ${VIEWER_SHORT_VERSION})
if(REVISION_FROM_VCS)
find_package(Git)
endif()
if((NOT REVISION_FROM_VCS) AND DEFINED ENV{CI_PIPELINE_ID})
set(VIEWER_VERSION_PATCH $ENV{CI_PIPELINE_ID})
message(STATUS "Revision (from environment): ${VIEWER_VERSION_PATCH}")
set(VIEWER_VERSION_REVISION $ENV{CI_PIPELINE_ID})
message(STATUS "Revision (from environment): ${VIEWER_VERSION_REVISION}")
elseif((NOT REVISION_FROM_VCS) AND DEFINED ENV{AUTOBUILD_BUILD_ID})
set(VIEWER_VERSION_PATCH $ENV{AUTOBUILD_BUILD_ID})
message(STATUS "Revision (from autobuild environment): ${VIEWER_VERSION_PATCH}")
set(VIEWER_VERSION_REVISION $ENV{AUTOBUILD_BUILD_ID})
message(STATUS "Revision (from autobuild environment): ${VIEWER_VERSION_REVISION}")
elseif(Git_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-list HEAD --count
......@@ -74,26 +77,24 @@ if(NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/ne
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(GIT_REV_LIST_COUNT)
set(VIEWER_VERSION_PATCH ${GIT_REV_LIST_COUNT})
set(VIEWER_VERSION_REVISION ${GIT_REV_LIST_COUNT})
else(GIT_REV_LIST_COUNT)
set(VIEWER_VERSION_PATCH 0)
set(VIEWER_VERSION_REVISION 0)
endif(GIT_REV_LIST_COUNT)
else()
set(VIEWER_VERSION_PATCH 0)
set(VIEWER_VERSION_REVISION 0)
endif()
message(STATUS "Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}")
if("${VIEWER_VERSION_PATCH}" STREQUAL "")
message(STATUS "Ultimate fallback, revision was blank or not set: will use 0")
set(VIEWER_VERSION_PATCH 0)
endif("${VIEWER_VERSION_PATCH}" STREQUAL "")
set(VIEWER_SHORT_VERSION "${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}")
message(STATUS "Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
else(EXISTS ${VIEWER_VERSION_BASE_FILE})
message(SEND_ERROR "Cannot get viewer version from '${VIEWER_VERSION_BASE_FILE}'")
endif(EXISTS ${VIEWER_VERSION_BASE_FILE})
set(VIEWER_VERSION_AND_CHANNEL "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}")
if("${VIEWER_VERSION_REVISION}" STREQUAL "")
message(STATUS "Ultimate fallback, revision was blank or not set: will use 0")
set(VIEWER_VERSION_REVISION 0)
endif("${VIEWER_VERSION_REVISION}" STREQUAL "")
set(VIEWER_VERSION_AND_CHANNEL "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
endif(NOT DEFINED VIEWER_SHORT_VERSION)
if (NOT DEFINED VIEWER_COMMIT_LONG_SHA)
......@@ -138,4 +139,20 @@ if (NOT DEFINED VIEWER_COMMIT_SHORT_SHA)
else()
set(VIEWER_COMMIT_SHORT_SHA 0)
endif()
endif (NOT DEFINED VIEWER_COMMIT_SHORT_SHA)
\ No newline at end of file
endif (NOT DEFINED VIEWER_COMMIT_SHORT_SHA)
add_library( ll::versioninfo INTERFACE IMPORTED )
target_compile_definitions( ll::versioninfo INTERFACE
$<$<CONFIG:Debug>:LLBUILD_CONFIG="Debug">
$<$<CONFIG:RelWithDebInfo>:LLBUILD_CONFIG="RelWithDebInfo">
$<$<CONFIG:Release>:LLBUILD_CONFIG="Release">
LL_VIEWER_CHANNEL="${VIEWER_CHANNEL}"
LL_VIEWER_CHANNEL_CODENAME="${VIEWER_CHANNEL_CODENAME_INTERNAL}"
LL_VIEWER_CHANNEL_AND_VERSION="${VIEWER_VERSION_AND_CHANNEL}"
LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}
LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}
LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}
LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}
LL_VIEWER_COMMIT_SHA="${VIEWER_COMMIT_LONG_SHA}"
LL_VIEWER_COMMIT_SHORT_SHA="${VIEWER_COMMIT_SHORT_SHA}"
)