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

💥 Devendored all deps #144

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
70 changes: 70 additions & 0 deletions .github/workflows/build-conan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build server

on: [push, pull_request]

jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
BUILD_TOOLS_PATH: C:\apps\build-tools\
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- run: echo $env:BUILD_TOOLS_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: startsWith(matrix.os, 'windows')

- uses: actions/checkout@v4

- name: Cache conan
uses: actions/cache@v3
with:
key: conan-${{ matrix.os }}-${{ hashFiles('conanfile.py') }}
path: ~/.conan2/

- name: Enable Developer Command Prompt
uses: ilammy/[email protected]

- name: Install dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash
sudo apt-get update
sudo apt-get -y install ninja-build

- name: Install dependencies (Windows)
if: startsWith(matrix.os, 'windows')
shell: cmd
run: git clone https://git.anotherfoxguy.com/AnotherFoxGuy/build-tools.git %BUILD_TOOLS_PATH%

- name: Configure (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
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 ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f
conan install . -s build_type=Release -b missing -pr:b=default -c tools.cmake.cmaketoolchain:generator="Ninja"
cmake --preset conan-release
shell: bash


- name: Configure (Windows)
if: startsWith(matrix.os, 'windows')
run: |
conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f
conan install . -b missing -pr:b=tools/conan-profiles/vs-22-release-ninja -pr=tools/conan-profiles/vs-22-release-ninja
cmake --preset conan-release
shell: cmd

- name: Build
run: ninja

- name: Upload bin folder
uses: actions/upload-artifact@v4
with:
name: ror-server-${{ matrix.os }}
path: bin
26 changes: 26 additions & 0 deletions .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Linux with Sysdeps

on: [push, pull_request]

jobs:
linux:
runs-on: ubuntu-20.04
steps:
- name: Install build Dependencies
run: |
sudo apt update
sudo apt install -y libjsoncpp-dev fakeroot libarchive-tools python3-apt zstd gettext
curl "https://cdn.anotherfoxguy.com/makedeb/install-makedeb.sh" | sudo bash

- name: Install angelscript
run: git clone https://mpr.makedeb.org/angelscript.git && cd angelscript && makedeb -is
- name: Install socketw
run: git clone https://mpr.makedeb.org/socketw.git && cd socketw && makedeb -is

- uses: actions/checkout@v2

- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=Release .

- name: Build
run: make -j4
33 changes: 0 additions & 33 deletions .github/workflows/build.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ bin/*
!bin/pthreadVC2.dll
_build
build

cmake-build-debug/

cmake-build-*/
\.idea/
CMakeUserPresets.json
36 changes: 23 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
# ensure cmake features we need
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

include(CMakeDependentOption)
include(FeatureSummary)

project(rorserver VERSION "2021.10")

# Options
set(ROR_DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/dependencies/build" CACHE PATH "Path to the dependencies")
set(CMAKE_PREFIX_PATH ${ROR_DEPENDENCY_DIR} ${CMAKE_PREFIX_PATH})

set(CMAKE_THREAD_PREFER_PTHREAD YES)
find_package(Threads REQUIRED)
find_package(Angelscript)
find_package(jsoncpp REQUIRED)
find_package(SocketW REQUIRED)
cmake_dependent_option(RORSERVER_WITH_ANGELSCRIPT "Adds scripting support" ON "AngelScript_FOUND" OFF)

# setup paths
SET(RUNTIME_OUTPUT_DIRECTORY "${rorserver_SOURCE_DIR}/bin/")
SET(LIBRARY_OUTPUT_DIRECTORY "${rorserver_SOURCE_DIR}/lib/")
SET(ARCHIVE_OUTPUT_DIRECTORY "${rorserver_SOURCE_DIR}/lib/")
SET(RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
SET(LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/")
SET(ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/")
SET(EXECUTABLE_OUTPUT_PATH ${RUNTIME_OUTPUT_DIRECTORY})
SET(LIBRARY_OUTPUT_PATH ${RUNTIME_OUTPUT_DIRECTORY})

#options
option(RORSERVER_WITH_ANGELSCRIPT "adds scripting support" FALSE)

# hide some settings
mark_as_advanced(
Expand Down Expand Up @@ -57,7 +70,7 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${RUNTIME_OUTPUT_DIRECTORY})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${RUNTIME_OUTPUT_DIRECTORY})


if (NOT WIN32)
if (UNIX)
add_definitions(-Wall)
option(RORSERVER_CRASHHANDLER "enables linux startup script crashhandling" FALSE)

Expand All @@ -69,12 +82,9 @@ if (NOT WIN32)
mark_as_advanced(GDB_EXECUTABLE)
endif ()


add_subdirectory("dependencies/socketw")
add_subdirectory("dependencies/jsoncpp")

if (RORSERVER_WITH_ANGELSCRIPT)
add_subdirectory("source/angelscript_add_on")
endif ()
add_subdirectory("source/server")

if (RORSERVER_WITH_ANGELSCRIPT)
add_subdirectory("dependencies/angelscript")
endif (RORSERVER_WITH_ANGELSCRIPT)
feature_summary(WHAT ALL)
60 changes: 60 additions & 0 deletions cmake/FindAngelscript.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# The MIT License (MIT)
#
# Copyright (c) 2015 Fabian Killus
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# Find AngelScript
# ----------------
#
# Find AngelScript include directories and libraries.
# This module will set the following variables:
#
# * Angelscript_FOUND - True if AngelScript is found
# * Angelscript_INCLUDE_DIR - The include directory
# * Angelscript_LIBRARY - The libraries to link against
#
# In addition the following imported targets are defined:
#
# * Angelscript::angelscript
# * AngelScript::use_namespace
#

find_path(Angelscript_INCLUDE_DIR angelscript.h)
find_library(Angelscript_LIBRARY angelscript PATH_SUFFIXES Debug Release)

set(Angelscript_INCLUDE_DIRS ${Angelscript_INCLUDE_DIR})
set(Angelscript_LIBRARIES ${Angelscript_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Angelscript FOUND_VAR Angelscript_FOUND
REQUIRED_VARS Angelscript_INCLUDE_DIRS Angelscript_LIBRARIES
)

if (Angelscript_FOUND)
add_library(Angelscript::angelscript INTERFACE IMPORTED)
set_target_properties(Angelscript::angelscript PROPERTIES
INTERFACE_LINK_LIBRARIES "${Angelscript_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${Angelscript_INCLUDE_DIRS}"
)
add_library(Angelscript::use_namespace INTERFACE IMPORTED)
set_target_properties(Angelscript::use_namespace PROPERTIES INTERFACE_COMPILE_DEFINITIONS AS_USE_NAMESPACE)
endif ()

mark_as_advanced(Angelscript_INCLUDE_DIR Angelscript_LIBRARY)
60 changes: 60 additions & 0 deletions cmake/FindSocketW.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# The MIT License (MIT)
#
# Copyright (c) 2015 Fabian Killus
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# Find SocketW
# ------------
#
# Find SocketW include directories and libraries.
# This module will set the following variables:
#
# * SocketW_FOUND - True if SocketW is found
# * SocketW_INCLUDE_DIRS - The include directory
# * SocketW_LIBRARIES - The libraries to link against
#
# In addition the following imported targets are defined:
#
# * SocketW::SocketW
#

find_path(SocketW_INCLUDE_DIR SocketW.h)
find_library(SocketW_LIBRARY SocketW)

set(SocketW_INCLUDE_DIRS ${SocketW_INCLUDE_DIR})
set(SocketW_LIBRARIES ${SocketW_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SocketW FOUND_VAR SocketW_FOUND
REQUIRED_VARS SocketW_INCLUDE_DIRS SocketW_LIBRARIES
)

if (SocketW_FOUND)
add_library(SocketW::SocketW INTERFACE IMPORTED)
set_target_properties(SocketW::SocketW PROPERTIES
INTERFACE_LINK_LIBRARIES "${SocketW_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${SocketW_INCLUDE_DIRS}"
)
if (WIN32)
set_property(TARGET SocketW::SocketW APPEND PROPERTY INTERFACE_LINK_LIBRARIES ws2_32)
endif ()
endif ()

mark_as_advanced(SocketW_INCLUDE_DIR SocketW_LIBRARY)
18 changes: 18 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
from conan import ConanFile
from conan.tools.files import copy


class RoRServer(ConanFile):
name = "RoRServer"
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps"

def layout(self):
self.folders.generators = os.path.join(self.folders.build, "generators")

def requirements(self):
self.requires("angelscript/2.37.0")
self.requires("jsoncpp/1.9.5")
self.requires("openssl/3.3.2", override=True)
self.requires("socketw/3.11.0@anotherfoxguy/stable")
Loading
Loading