diff --git a/contrib/teamcity/build-configurations.py b/contrib/teamcity/build-configurations.py --- a/contrib/teamcity/build-configurations.py +++ b/contrib/teamcity/build-configurations.py @@ -111,6 +111,14 @@ self.junit_reports_dir = self.build_directory.joinpath("test/junit") self.test_logs_dir = self.build_directory.joinpath("test/log") + # We will provide the required environment variables + self.environment_variables = { + "BUILD_DIR": str(self.build_directory), + "CMAKE_PLATFORMS_DIR": self.project_root.joinpath("cmake", "platforms"), + "THREADS": str(os.cpu_count() or 1), + "TOPLEVEL": str(self.project_root), + } + def create_build_steps(self, artifact_dir): # There are 2 possibilities to define the build steps: # - By defining a script to run. If such a script is set and is @@ -236,19 +244,10 @@ def __init__(self, configuration): self.configuration = configuration - project_root = self.configuration.project_root build_directory = self.configuration.build_directory self.artifact_dir = build_directory.joinpath("artifacts") - # We will provide the required environment variables - self.environment_variables = { - "BUILD_DIR": str(build_directory), - "CMAKE_PLATFORMS_DIR": project_root.joinpath("cmake", "platforms"), - "THREADS": str(os.cpu_count() or 1), - "TOPLEVEL": str(project_root), - } - # Build 2 log files: # - the full log will contain all unfiltered content # - the clean log will contain the same filtered content as what is @@ -345,7 +344,7 @@ cwd=self.configuration.build_directory, env={ **os.environ, - **self.environment_variables, + **self.configuration.environment_variables, **self.configuration.get("env", {}), "CMAKE_FLAGS": " ".join(self.configuration.cmake_flags), },