mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:50:05 +00:00 
			
		
		
		
	Setup script cleanup for Linux
This commit is contained in:
		
							parent
							
								
									3de270c2a1
								
							
						
					
					
						commit
						6fca723404
					
				
					 10 changed files with 80 additions and 20 deletions
				
			
		
							
								
								
									
										39
									
								
								tools/configure-environment.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										39
									
								
								tools/configure-environment.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,39 @@ | ||||||
|  | #!/bin/bash | ||||||
|  | script_dir="$(dirname "$(readlink -f "$0")")" | ||||||
|  | 
 | ||||||
|  | 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 ${PIP_FLAGS} -r "${script_dir}/../requirements.txt" | ||||||
|  | 
 | ||||||
|  | # Configure default Conan profile | ||||||
|  | conan profile detect -e | ||||||
|  | 
 | ||||||
|  | # Conan profiles | ||||||
|  | conan_profiles=( | ||||||
|  |     "scwx-linux_clang-17" | ||||||
|  |     "scwx-linux_clang-17_armv8" | ||||||
|  |     "scwx-linux_clang-18" | ||||||
|  |     "scwx-linux_clang-18_armv8" | ||||||
|  |     "scwx-linux_gcc-11" | ||||||
|  |     "scwx-linux_gcc-11_armv8" | ||||||
|  |     "scwx-linux_gcc-12" | ||||||
|  |     "scwx-linux_gcc-12_armv8" | ||||||
|  |     "scwx-linux_gcc-13" | ||||||
|  |     "scwx-linux_gcc-13_armv8" | ||||||
|  |     "scwx-linux_gcc-14" | ||||||
|  |     "scwx-linux_gcc-14_armv8" | ||||||
|  |     ) | ||||||
|  | 
 | ||||||
|  | # Install Conan profiles | ||||||
|  | for profile_name in "${conan_profiles[@]}"; do | ||||||
|  |     conan config install "${script_dir}/conan/profiles/${profile_name}" -tf profiles | ||||||
|  | done | ||||||
							
								
								
									
										0
									
								
								tools/lib/common-paths.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								tools/lib/common-paths.sh
									
										
									
									
									
										
										
										Normal file → Executable 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%" ^ |     -G "%generator%" ^ | ||||||
|     -DCMAKE_PREFIX_PATH="%qt_base%/%qt_version%/%qt_arch%" ^ |     -DCMAKE_PREFIX_PATH="%qt_base%/%qt_version%/%qt_arch%" ^ | ||||||
|     -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="%script_dir%\..\..\external\cmake-conan\conan_provider.cmake" ^ |     -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="%script_dir%\..\..\external\cmake-conan\conan_provider.cmake" ^ | ||||||
|     -DCONAN_HOST_PROFILE=%conan_profile% ^ |     -DCONAN_HOST_PROFILE=%conan_profile% ^ | ||||||
|     -DCONAN_BUILD_PROFILE=%conan_profile% |     -DCONAN_BUILD_PROFILE=%conan_profile% | ||||||
| 
 | 
 | ||||||
| if defined build_type ( | @if defined build_type ( | ||||||
|     set cmake_args=%cmake_args% ^ |     set cmake_args=%cmake_args% ^ | ||||||
|         -DCMAKE_BUILD_TYPE=%build_type% ^ |         -DCMAKE_BUILD_TYPE=%build_type% ^ | ||||||
|         -DCMAKE_CONFIGURATION_TYPES=%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% | cmake %cmake_args% | ||||||
|  |  | ||||||
							
								
								
									
										6
									
								
								tools/lib/run-cmake-configure.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										6
									
								
								tools/lib/run-cmake-configure.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							|  | @ -17,6 +17,12 @@ if [[ -n "${build_type}" ]]; then | ||||||
|         -DCMAKE_CONFIGURATION_TYPES="${build_type}" |         -DCMAKE_CONFIGURATION_TYPES="${build_type}" | ||||||
|         -DCMAKE_INSTALL_PREFIX="${build_dir}/${build_type}/supercell-wx" |         -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 | fi | ||||||
| 
 | 
 | ||||||
| mkdir -p "${build_dir}" | mkdir -p "${build_dir}" | ||||||
|  |  | ||||||
							
								
								
									
										22
									
								
								tools/lib/setup-common.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										22
									
								
								tools/lib/setup-common.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							|  | @ -2,26 +2,36 @@ | ||||||
| script_dir="$(dirname "$(readlink -f "$0")")" | script_dir="$(dirname "$(readlink -f "$0")")" | ||||||
| 
 | 
 | ||||||
| # Import common paths | # 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 | # 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 | if [[ -n "${build_type}" ]]; then | ||||||
|     # Install Conan profile and packages |     # Install Conan profile and packages | ||||||
|     ./setup-conan.sh |     ${script_dir}/setup-conan.sh | ||||||
| else | else | ||||||
|     # Install Conan profile and debug packages |     # Install Conan profile and debug packages | ||||||
|     export build_type=Debug |     export build_type=Debug | ||||||
|     ./setup-conan.sh |     ${script_dir}/setup-conan.sh | ||||||
| 
 | 
 | ||||||
|     # Install Conan profile and release packages |     # Install Conan profile and release packages | ||||||
|     export build_type=Release |     export build_type=Release | ||||||
|     ./setup-conan.sh |     ${script_dir}/setup-conan.sh | ||||||
| 
 | 
 | ||||||
|     # Unset build_type |     # Unset build_type | ||||||
|     unset build_type |     unset build_type | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| # Run CMake Configure | # Run CMake Configure | ||||||
| ./run-cmake-configure.sh | ${script_dir}/run-cmake-configure.sh | ||||||
|  |  | ||||||
							
								
								
									
										0
									
								
								tools/lib/setup-conan.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								tools/lib/setup-conan.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										4
									
								
								tools/setup-debug.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										4
									
								
								tools/setup-debug.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							|  | @ -1,7 +1,7 @@ | ||||||
| #!/bin/bash | #!/bin/bash | ||||||
| script_dir="$(dirname "$(readlink -f "$0")")" | script_dir="$(dirname "$(readlink -f "$0")")" | ||||||
| 
 | 
 | ||||||
| export build_dir=${1:-${script_dir}/../build-debug} | export build_dir="${1:-${script_dir}/../build-debug}" | ||||||
| export build_type=Debug | export build_type=Debug | ||||||
| export conan_profile=${2:-scwx-linux_gcc-11} | export conan_profile=${2:-scwx-linux_gcc-11} | ||||||
| export generator=Ninja | export generator=Ninja | ||||||
|  | @ -9,4 +9,4 @@ export qt_base=/opt/Qt | ||||||
| export qt_arch=gcc_64 | export qt_arch=gcc_64 | ||||||
| 
 | 
 | ||||||
| # Perform common setup | # Perform common setup | ||||||
| ./lib/setup-common.sh | ${script_dir}/lib/setup-common.sh | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| @set build_dir=%script_dir%\..\build-ninja | @set build_dir=%script_dir%\..\build-ninja | ||||||
| @set conan_profile=scwx-win64_msvc2022 | @set conan_profile=scwx-win64_msvc2022 | ||||||
| @set generator=Ninja | @set generator=Ninja Multi-Config | ||||||
| @set qt_base=C:/Qt | @set qt_base=C:/Qt | ||||||
| @set qt_arch=msvc2022_64 | @set qt_arch=msvc2022_64 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										8
									
								
								tools/setup-multi.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										8
									
								
								tools/setup-multi.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							|  | @ -1,9 +1,11 @@ | ||||||
| #!/bin/bash | #!/bin/bash | ||||||
| export build_dir=${1:-build-release} | script_dir="$(dirname "$(readlink -f "$0")")" | ||||||
|  | 
 | ||||||
|  | export build_dir="${1:-${script_dir}/../build}" | ||||||
| export conan_profile=${2:-scwx-linux_gcc-11} | export conan_profile=${2:-scwx-linux_gcc-11} | ||||||
| export generator=Ninja | export generator="Ninja Multi-Config" | ||||||
| export qt_base=/opt/Qt | export qt_base=/opt/Qt | ||||||
| export qt_arch=gcc_64 | export qt_arch=gcc_64 | ||||||
| 
 | 
 | ||||||
| # Perform common setup | # Perform common setup | ||||||
| ./lib/setup-common.sh | ${script_dir}/lib/setup-common.sh | ||||||
|  |  | ||||||
							
								
								
									
										4
									
								
								tools/setup-release.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										4
									
								
								tools/setup-release.sh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							|  | @ -1,7 +1,7 @@ | ||||||
| #!/bin/bash | #!/bin/bash | ||||||
| script_dir="$(dirname "$(readlink -f "$0")")" | script_dir="$(dirname "$(readlink -f "$0")")" | ||||||
| 
 | 
 | ||||||
| export build_dir=${1:-${script_dir}/../build-release} | export build_dir="${1:-${script_dir}/../build-release}" | ||||||
| export build_type=Release | export build_type=Release | ||||||
| export conan_profile=${2:-scwx-linux_gcc-11} | export conan_profile=${2:-scwx-linux_gcc-11} | ||||||
| export generator=Ninja | export generator=Ninja | ||||||
|  | @ -9,4 +9,4 @@ export qt_base=/opt/Qt | ||||||
| export qt_arch=gcc_64 | export qt_arch=gcc_64 | ||||||
| 
 | 
 | ||||||
| # Perform common setup | # Perform common setup | ||||||
| ./lib/setup-common.sh | ${script_dir}/lib/setup-common.sh | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat