Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Replace vcpkg with conan #641

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
90c2741
:construction: Replace vcpkg with conan
AnotherFoxGuy Aug 13, 2023
9d6b6e8
:package: Added scribe pkg
AnotherFoxGuy Aug 15, 2023
a4f5336
:package: Added nvidia-texture-tools pkg
AnotherFoxGuy Aug 15, 2023
c2ad1a3
:package: Added polyvox pkg
AnotherFoxGuy Aug 15, 2023
1de0e40
:package: Added liblo pkg
AnotherFoxGuy Sep 17, 2023
8e04f4e
:wrench: Add conan profiles
AnotherFoxGuy Sep 17, 2023
a334bf6
:package: Added qt config
AnotherFoxGuy Sep 17, 2023
77a0069
:package: Added libnode pkg
AnotherFoxGuy Sep 22, 2023
9976d39
:package: Added openvr pkg
AnotherFoxGuy Sep 22, 2023
be48266
:wrench: Updated conanfile
AnotherFoxGuy Sep 22, 2023
55ffdce
:package: Added quazip pkg
AnotherFoxGuy Sep 22, 2023
888516b
:bug: Fixed libnode pkg build
AnotherFoxGuy Sep 22, 2023
69214da
:wrench: Added older version of polyvox
AnotherFoxGuy Sep 22, 2023
240cab1
:construction: WIP build with conan
AnotherFoxGuy Sep 22, 2023
b107140
:bug: Fixed libnode conan pkg build
AnotherFoxGuy Sep 23, 2023
1dbb94c
:wrench: Downgrade draco
AnotherFoxGuy Sep 23, 2023
a8debb1
:bug: Fixed shadergen unable to find tools
AnotherFoxGuy Sep 24, 2023
3347a2f
:bug: Fixed package_libraries_for_deployment()
AnotherFoxGuy Sep 24, 2023
71622ef
:bug: Fixed nvidia-texture-tools build settings
AnotherFoxGuy Sep 24, 2023
2210302
:bug: Fixed polyvox includedirs on linux
AnotherFoxGuy Sep 24, 2023
3c001ca
:bug: Fixed broken libnode package
AnotherFoxGuy Sep 24, 2023
c277656
:construction_worker: Disabled gh-actions for now
AnotherFoxGuy Sep 24, 2023
12aeee3
:wrench: Added tool to automatically update conan packages
AnotherFoxGuy Sep 25, 2023
74224dd
:bug: Fixed FixupBundlePostBuild failing to find QT dlls
AnotherFoxGuy Sep 25, 2023
e7f53e4
:bug: Fixed domain-server build
AnotherFoxGuy Sep 25, 2023
d9c2907
:bug: Fixed texturetest build
AnotherFoxGuy Sep 25, 2023
4e70513
:bug: Fixed ktx-tool build
AnotherFoxGuy Sep 25, 2023
2147275
:bug: Fixed nitpick build
AnotherFoxGuy Sep 25, 2023
a549bbf
:bug: Fixed render-texture-load build
AnotherFoxGuy Sep 25, 2023
76da3cc
:wrench: Disabled gpu-frame-player and vhacd-util
AnotherFoxGuy Sep 25, 2023
0a71392
:construction_worker: Added a simple CI build
AnotherFoxGuy Sep 25, 2023
f959738
:wrench: Removed unused bullet components
AnotherFoxGuy Sep 25, 2023
9228f8a
:construction_worker: Add missing QT install step
AnotherFoxGuy Sep 25, 2023
cb2b316
:bug: Fixed build failing when using Ninja
AnotherFoxGuy Sep 27, 2023
f85d7b0
:wrench: Disabled webrtc completely
AnotherFoxGuy Sep 27, 2023
d7c1d5e
:green_heart: Fixed CI
AnotherFoxGuy Sep 27, 2023
af69d40
:wrench: Move conan generated files to a subfolder
AnotherFoxGuy Sep 28, 2023
443dfb4
:wrench: Disabled unused SDL2 features
AnotherFoxGuy Oct 1, 2023
0fb9090
:wrench: Let cmake find the python3 executable
AnotherFoxGuy Oct 1, 2023
42c9814
Update OpenEXR to 3.1.9 and fix deprecation warnings
JulianGro Oct 2, 2023
9b10784
Use python3 instead of python binary for configuring libnode on Linux
JulianGro Oct 2, 2023
97112d1
Allow building libnode on aarch64
JulianGro Oct 9, 2023
b50e2f1
:bug: Fixed missing discord-rpc package
AnotherFoxGuy Nov 8, 2023
76448ab
:bug: Fixed missing lib in liblo conan pkg
AnotherFoxGuy Dec 8, 2023
6706841
:bug: Fixed missing WIN32 definition when building with ninja
AnotherFoxGuy Dec 8, 2023
dc0f03f
:bug: Fixed OpenVR failing to link on windows
AnotherFoxGuy Jan 22, 2024
7943457
:wrench: Reenabled build with WebRTC
AnotherFoxGuy Jan 22, 2024
a31b78d
:package: Added SteamWorks Conan package
AnotherFoxGuy Jan 24, 2024
6998f72
:package: Added OVR Conan package
AnotherFoxGuy Jan 24, 2024
259030b
:package: Added NeuronDataReader Conan package
AnotherFoxGuy Jan 24, 2024
8dcec58
:package: Added GifCreator Conan package
AnotherFoxGuy Jan 24, 2024
d3e441f
:fire: Removed external cmake packages
AnotherFoxGuy Jan 24, 2024
79daf1f
:wrench: Use conan packages instead of cmake external projects
AnotherFoxGuy Jan 24, 2024
727681b
:bug: Fixed dependencies on Linux
AnotherFoxGuy Feb 13, 2024
b733a6e
:wrench: Don't generate a qt.conf on Linux
AnotherFoxGuy Feb 23, 2024
f8e64b2
:construction_worker: Updated gh actions
AnotherFoxGuy Feb 24, 2024
5181ba3
:bug: Fixed building manual tests
AnotherFoxGuy Feb 25, 2024
d11aa3f
:bug: Fixed building tests
AnotherFoxGuy Feb 25, 2024
346092c
:package: Added cgltf Conan package
AnotherFoxGuy Feb 26, 2024
b5cf984
:bug: Fixed polyvox trying to build bindings
AnotherFoxGuy Feb 27, 2024
eb05679
:bug: Fixed missing libraries on Linux
AnotherFoxGuy Feb 27, 2024
db44995
:wrench: Simplify FixupBundlePostBuild
AnotherFoxGuy Feb 27, 2024
2688256
:arrow_up: Updated liblo and node package
AnotherFoxGuy Mar 1, 2024
df05172
:arrow_down: Downgraded GLM
AnotherFoxGuy Mar 18, 2024
071c177
:wrench: Disable WebRTC by default
AnotherFoxGuy May 25, 2024
3aaef6e
Fix hang on Linux due to some sort of bug in Qt's SSL initialization …
daleglass Jun 3, 2024
1f5900d
:arrow_up: Updated SDL to 2.30.3
AnotherFoxGuy Jun 9, 2024
9251c71
:arrow_up: Updated cgltf to 1.14
AnotherFoxGuy Jun 11, 2024
e35e1bc
:wrench: Added artery-font-format
AnotherFoxGuy Jun 11, 2024
a9190fc
:arrow_up: Updated google-webrtc to 124
AnotherFoxGuy Jul 12, 2024
35f2231
:wrench: Use system OpenSSL on Linux
AnotherFoxGuy Sep 27, 2024
e26b0c6
:wrench: Switch back to prebuild WebRTC for now
AnotherFoxGuy Sep 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
134 changes: 134 additions & 0 deletions .github/workflows/build-overte.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
name: Build game

on: [ push, pull_request ]

jobs:
build-gcc:
name: Linux build on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1

- name: Cache conan
id: cache-conan
uses: actions/cache@v4
with:
key: conan-ubuntu-${{ hashFiles('conanfile.py') }}
restore-keys: |
conan-ubuntu-
path: ~/.conan2/

- name: Install dependencies
run: |
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash
sudo apt-get update
sudo apt-get -y install \
pkg-config \
ninja-build \
qtbase5-dev \
qtbase5-private-dev \
qtwebengine5-dev \
qtwebengine5-dev-tools \
qtmultimedia5-dev \
libqt5opengl5-dev \
qtscript5-dev \
libqt5scripttools5 \
libqt5webchannel5-dev \
libqt5websockets5-dev \
qtxmlpatterns5-dev-tools \
qttools5-dev \
libqt5xmlpatterns5-dev \
libqt5svg5-dev \
qml-module-qtwebchannel \
qml-module-qtquick-controls \
qml-module-qtquick-controls2 \
qml-module-qt-labs-settings \
qml-module-qtquick-dialogs \
qml-module-qtwebengine
shell: bash

- name: Fix broken mpg123 lib
if: steps.cache-conan.outputs.cache-hit != 'true'
run: |
conan profile detect --force
echo "tools.system.package_manager:mode = install" > ~/.conan2/global.conf
echo "tools.system.package_manager:sudo = True" >> ~/.conan2/global.conf
conan remote add overte https://git.anotherfoxguy.com/api/packages/overte/conan -f
conan install --requires mpg123/1.31.2 -b mpg123/1.31.2 -b missing

- name: Install conan pkgs
run: |
conan install . \
-s build_type=Release \
-b missing \
-pr:b=default \
-c tools.cmake.cmaketoolchain:generator="Ninja" \
-of build
conan cache clean "*" -sbd
shell: bash

- name: Configure
run: cmake --preset conan-release
shell: bash

- name: Build
run: |
cd build
ninja
shell: bash

build-msvc:
name: Windows build
runs-on: windows-2019
env:
BUILD_TOOLS_PATH: C:\apps\build-tools\
steps:
- run: echo $env:BUILD_TOOLS_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1

- name: Install Build tools
run: git clone https://git.anotherfoxguy.com/AnotherFoxGuy/build-tools.git %BUILD_TOOLS_PATH%
shell: cmd

- name: Install Qt5
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: windows-QtCache
modules: qtwebengine

- name: Cache conan packages
uses: actions/cache@v4
with:
key: conan-windows-${{ hashFiles('conanfile.py') }}
restore-keys: |
conan-windows-
path: ~/.conan2

- name: Install conan pkgs
run: |
conan remote add overte https://git.anotherfoxguy.com/api/packages/overte/conan -f
conan install . -b missing -pr:b=tools/conan-profiles/vs-19-release-ninja -pr=tools/conan-profiles/vs-19-release-ninja -of build
conan cache clean "*" -sbd
shell: cmd

- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1

- name: Configure
run: cmake --preset conan-release
shell: cmd

- name: Build
run: |
cd build
ninja
shell: cmd
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,7 @@ interface/compiledResources
# Act local GitHub Actions
.secret


_build/

CMakeUserPresets.json
113 changes: 11 additions & 102 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,67 +18,32 @@ cmake_minimum_required(VERSION 3.14)
# This should allow using long paths on Windows
SET(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")

# Passing of variables to vcpkg
#
# vcpkg runs cmake scripts in an isolated environment, see this for details:
# https://github.com/Microsoft/vcpkg/issues/3712
#
# Here's how this works and how we work around this issue:
#
# 1. This file (CMakeLists.txt) runs first and is authoritative. It is the one
# that reads the environment, sets variables and sets a default value.
# 2. It writes the contents of the variables to
# $CMAKE_CURRENT_BINARY_DIR/_env/$VARNAME
# 3. hifi_vcpkg.py takes the _env directory, and copies it to the vcpkg dir.
# This solves the issue of CMakeLists.txt not knowing where the vcpkg dir is.
# 4. cmake/ports/*/portfile.cmake does know where the vcpkg dir is, and can
# read the _env that was copied there to obtain the variable's name.
#
# To ensure no old data could be accidentally read, the _env directories are
# deleted on each execution and fully recreated.

# Ensure nothing is kept from any previous run
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/_env")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/_env")

# Base URL for externally downloaded files
set(EXTERNAL_BUILD_ASSETS "https://build-deps.overte.org")

if( DEFINED ENV{EXTERNAL_BUILD_ASSETS} )
set(EXTERNAL_BUILD_ASSETS "$ENV{EXTERNAL_BUILD_ASSETS}")
endif()

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_env/EXTERNAL_BUILD_ASSETS.txt" "${EXTERNAL_BUILD_ASSETS}")
MESSAGE(STATUS "EXTERNAL_BUILD_ASSETS: ${EXTERNAL_BUILD_ASSETS}")
include(SelectLibraryConfigurations)

# read USE_GLES enviroment variable and sets it as GLES option
# TODO still gets overwritten by "use GLES on linux aarch64"
set(GLES_OPTION "$ENV{USE_GLES}")

# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

# Instruct CMake to run rcc automatically when needed
set(CMAKE_AUTORCC ON)

# use GLES on linux aarch64
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(GLES_OPTION ON)
endif()

# Will affect VCPKG dependencies
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_env/USE_GLES.txt" "${GLES_OPTION}")
MESSAGE(STATUS "GLES_OPTION: ${GLES_OPTION}")

include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/macros/TargetPython.cmake")
target_python()

if (WIN32 AND NOT HIFI_ANDROID AND NOT (CMAKE_GENERATOR STREQUAL "Ninja"))
# Force x64 toolset
set(CMAKE_GENERATOR_TOOLSET "host=x64" CACHE STRING "64-bit toolset" FORCE)
endif()

# set our OS X deployment target
# (needs to be set before first project() call and before prebuild.py)
# Will affect VCPKG dependencies
if (APPLE)
set(ENV{MACOSX_DEPLOYMENT_TARGET} 10.11)
endif()

set(EXTERNAL_BUILD_ASSETS "https://build-deps.overte.org")

set(RELEASE_TYPE "$ENV{RELEASE_TYPE}")
if ((NOT "${RELEASE_TYPE}" STREQUAL "PRODUCTION") AND (NOT "${RELEASE_TYPE}" STREQUAL "PR"))
set(RELEASE_TYPE "DEV")
Expand All @@ -102,8 +67,6 @@ if( NOT WIN32 )
set(OVERTE_OPTIMIZE_FLAGS "")

if(OVERTE_OPTIMIZE)

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_env/OVERTE_OPTIMIZE.txt" "${OVERTE_OPTIMIZE}")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message("Clang compiler detected, adding -O3 -fPIC -g flags")
set(OVERTE_OPTIMIZE_FLAGS "-O3 -fPIC -g")
Expand All @@ -129,7 +92,6 @@ if( NOT WIN32 )
endif()

if(DEFINED OVERTE_CPU_ARCHITECTURE)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_env/OVERTE_CPU_ARCHITECTURE.txt" "${OVERTE_CPU_ARCHITECTURE}")
set(OVERTE_OPTIMIZE_FLAGS "${OVERTE_OPTIMIZE_FLAGS} ${OVERTE_CPU_ARCHITECTURE}")
message("Adding CPU architecture flags: ${OVERTE_CPU_ARCHITECTURE}")
MESSAGE(STATUS "OVERTE_CPU_ARCHITECTURE: ${OVERTE_CPU_ARCHITECTURE}")
Expand Down Expand Up @@ -194,53 +156,9 @@ if(OVERTE_WARNINGS_AS_ERRORS)
endif()


if (HIFI_ANDROID)
execute_process(
COMMAND ${HIFI_PYTHON_EXEC} ${CMAKE_CURRENT_SOURCE_DIR}/prebuild.py --release-type ${RELEASE_TYPE} --android ${HIFI_ANDROID_APP} --build-root ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULTS_VARIABLE PREBUILD_RET
)
else()
set(VCPKG_BUILD_TYPE_PARAM "")
if (VCPKG_BUILD_TYPE)
set(VCPKG_BUILD_TYPE_PARAM --vcpkg-build-type ${VCPKG_BUILD_TYPE})
endif()
execute_process(
COMMAND ${HIFI_PYTHON_EXEC} ${CMAKE_CURRENT_SOURCE_DIR}/prebuild.py --release-type ${RELEASE_TYPE} --build-root ${CMAKE_BINARY_DIR} ${VCPKG_BUILD_TYPE_PARAM}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULTS_VARIABLE PREBUILD_RET
)
endif()

if (PREBUILD_RET GREATER 0)
message(FATAL_ERROR "prebuild.py failed with error ${PREBUILD_RET}")
endif()
if(NOT EXISTS "${CMAKE_BINARY_DIR}/vcpkg.cmake")
message(FATAL_ERROR "vcpkg configuration missing.")
endif()
include("${CMAKE_BINARY_DIR}/vcpkg.cmake")

if (HIFI_ANDROID)
set(QT_CMAKE_PREFIX_PATH "$ENV{HIFI_ANDROID_PRECOMPILED}/qt/lib/cmake")
else()
if ("$ENV{OVERTE_USE_SYSTEM_QT}" STREQUAL "")
if(NOT EXISTS "${CMAKE_BINARY_DIR}/qt.cmake")
message(FATAL_ERROR "qt configuration missing.")
endif()
include("${CMAKE_BINARY_DIR}/qt.cmake")
message(STATUS "${CMAKE_BINARY_DIR}/qt.cmake included!")
else()
message(STATUS "System Qt in use, not including qt.cmake!")
endif()
endif()

option(VCPKG_APPLOCAL_DEPS OFF)

project(overte)
include("cmake/init.cmake")
include("cmake/compiler.cmake")
option(VCPKG_APPLOCAL_DEPS OFF)

add_paths_to_fixup_libs(${VCPKG_INSTALL_ROOT}/bin)
add_paths_to_fixup_libs(${VCPKG_INSTALL_ROOT}/debug/bin)

if (NOT DEFINED CLIENT_ONLY)
set(CLIENT_ONLY 0)
Expand All @@ -257,10 +175,7 @@ else()
endif()

set(SCREENSHARE 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our screenshare is supposed to be completely removed at some point. Just FYI.

if (APPLE AND NOT CLIENT_ONLY)
# Don't include Screenshare in OSX client-only builds.
set(SCREENSHARE 1)
endif()


# Use default time server if none defined in environment
set_from_env(TIMESERVER_URL TIMESERVER_URL "http://timestamp.comodoca.com?td=sha256")
Expand Down Expand Up @@ -421,12 +336,6 @@ endif()

set_packaging_parameters()

# Locate the required Qt build on the filesystem
setup_qt()

if ("$ENV{OVERTE_USE_SYSTEM_QT}" STREQUAL "")
list(APPEND CMAKE_PREFIX_PATH "${QT_CMAKE_PREFIX_PATH}")
endif()

find_package( Threads )

Expand All @@ -436,7 +345,7 @@ add_definitions(-DGLM_FORCE_CTOR_INIT)

if (WIN32)
# Deal with fakakta Visual Studo 2017 bug
add_definitions(-DQT_NO_FLOAT16_OPERATORS)
add_definitions(-DQT_NO_FLOAT16_OPERATORS -DWIN32)
endif()

if (HIFI_USE_OPTIMIZED_IK)
Expand Down
23 changes: 23 additions & 0 deletions cmake/FixupBundlePostBuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# FixupBundlePostBuild.cmake
# cmake
#
# Copyright 2015 High Fidelity, Inc.
# Created by Stephen Birarda on February 13, 2014
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#

include(BundleUtilities)

if (APPLE)
set(PLUGIN_EXTENSION "dylib")
elseif (WIN32)
set(PLUGIN_EXTENSION "dll")
else()
set(PLUGIN_EXTENSION "so")
endif()

file(GLOB EXTRA_PLUGINS "${BUNDLE_PLUGIN_DIR}/*.${PLUGIN_EXTENSION}")
fixup_bundle("${BUNDLE_EXECUTABLE}" "${EXTRA_PLUGINS}" "${LIB_PATHS}" IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
21 changes: 0 additions & 21 deletions cmake/externals/GifCreator/CMakeLists.txt

This file was deleted.

Loading
Loading