Setup script cleanup for Linux

This commit is contained in:
Dan Paulat 2025-05-25 19:08:40 -05:00
parent 3de270c2a1
commit 6fca723404
10 changed files with 80 additions and 20 deletions

0
tools/lib/common-paths.sh Normal file → Executable file
View file

View file

@ -1,19 +1,22 @@
@echo off
set script_dir=%~dp0
@set script_dir=%~dp0
set cmake_args=-B "%build_dir%" -S "%script_dir%\..\.." ^
@set cmake_args=-B "%build_dir%" -S "%script_dir%\..\.." ^
-G "%generator%" ^
-DCMAKE_PREFIX_PATH="%qt_base%/%qt_version%/%qt_arch%" ^
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="%script_dir%\..\..\external\cmake-conan\conan_provider.cmake" ^
-DCONAN_HOST_PROFILE=%conan_profile% ^
-DCONAN_BUILD_PROFILE=%conan_profile%
if defined build_type (
@if defined build_type (
set cmake_args=%cmake_args% ^
-DCMAKE_BUILD_TYPE=%build_type% ^
-DCMAKE_CONFIGURATION_TYPES=%build_type%
) else (
:: CMAKE_BUILD_TYPE isn't used to build, but is required by the Conan CMakeDeps generator
set cmake_args=%cmake_args% ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_CONFIGURATION_TYPES=Debug;Release
)
@echo on
mkdir "%build_dir%"
@mkdir "%build_dir%"
cmake %cmake_args%

6
tools/lib/run-cmake-configure.sh Normal file → Executable file
View file

@ -17,6 +17,12 @@ if [[ -n "${build_type}" ]]; then
-DCMAKE_CONFIGURATION_TYPES="${build_type}"
-DCMAKE_INSTALL_PREFIX="${build_dir}/${build_type}/supercell-wx"
)
else
# CMAKE_BUILD_TYPE isn't used to build, but is required by the Conan CMakeDeps generator
cmake_args+=(
-DCMAKE_BUILD_TYPE="Release"
-DCMAKE_CONFIGURATION_TYPES="Debug;Release"
)
fi
mkdir -p "${build_dir}"

22
tools/lib/setup-common.sh Normal file → Executable file
View file

@ -2,26 +2,36 @@
script_dir="$(dirname "$(readlink -f "$0")")"
# Import common paths
source ./common-paths.sh
source ${script_dir}/common-paths.sh
IN_VENV=$(python -c 'import sys; print(sys.prefix != getattr(sys, "base_prefix", sys.prefix))')
if [ "${IN_VENV}" = "True" ]; then
# In a virtual environment, don't use --user
PIP_FLAGS="--upgrade"
else
# Not in a virtual environment, use --user
PIP_FLAGS="--upgrade --user"
fi
# Install Python packages
pip install --upgrade --user ${script_dir}/../../requirements.txt
pip install ${PIP_FLAGS} -r ${script_dir}/../../requirements.txt
if [[ -n "${build_type}" ]]; then
# Install Conan profile and packages
./setup-conan.sh
${script_dir}/setup-conan.sh
else
# Install Conan profile and debug packages
export build_type=Debug
./setup-conan.sh
${script_dir}/setup-conan.sh
# Install Conan profile and release packages
export build_type=Release
./setup-conan.sh
${script_dir}/setup-conan.sh
# Unset build_type
unset build_type
fi
# Run CMake Configure
./run-cmake-configure.sh
${script_dir}/run-cmake-configure.sh

0
tools/lib/setup-conan.sh Normal file → Executable file
View file