aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/project
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-01-25 12:24:09 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-01-25 12:32:43 +0300
commitb265ab254b23edca357fcecbd0afade26d5a66ac (patch)
tree4395624af00d71dc43ff3bfe2d65e37f39798037 /project
parentREADME: update (diff)
downloadcmake-common-b265ab254b23edca357fcecbd0afade26d5a66ac.tar.gz
cmake-common-b265ab254b23edca357fcecbd0afade26d5a66ac.zip
project.ci: auto-fill --toolset from environment
Diffstat (limited to '')
-rw-r--r--project/ci/boost.py6
-rw-r--r--project/ci/cmake.py6
-rw-r--r--project/ci/dirs.py6
3 files changed, 8 insertions, 10 deletions
diff --git a/project/ci/boost.py b/project/ci/boost.py
index 0320b1a..861dc1a 100644
--- a/project/ci/boost.py
+++ b/project/ci/boost.py
@@ -9,7 +9,6 @@ import sys
from project.boost.build import BuildParameters, build
from project.boost.download import DownloadParameters, download
-from project.boost.toolchain import ToolchainType
from project.ci.dirs import Dirs
from project.linkage import Linkage
from project.utils import setup_logging
@@ -30,9 +29,6 @@ def _parse_args(argv=None):
parser.add_argument('--runtime-link', metavar='LINKAGE',
type=Linkage.parse,
help='how the libraries link to the runtime')
- parser.add_argument('--toolset', metavar='TOOLSET',
- type=ToolchainType.parse,
- help='toolset to use')
parser.add_argument('b2_args', metavar='B2_ARG',
nargs='*', default=[],
@@ -57,7 +53,7 @@ def build_ci(dirs, argv=None):
configurations=(dirs.get_configuration(),),
link=args.link,
runtime_link=args.runtime_link,
- toolset=args.toolset,
+ toolset=dirs.get_toolset(),
b2_args=args.b2_args)
build(params)
diff --git a/project/ci/cmake.py b/project/ci/cmake.py
index ff21873..6635dbf 100644
--- a/project/ci/cmake.py
+++ b/project/ci/cmake.py
@@ -10,7 +10,6 @@ import sys
from project.ci.dirs import Dirs
from project.cmake.build import BuildParameters, build
-from project.toolchain import ToolchainType
from project.utils import setup_logging
@@ -27,9 +26,6 @@ def _parse_args(argv=None):
help='install the project')
parser.add_argument('--boost', metavar='DIR', dest='boost_dir',
help='set Boost directory path')
- parser.add_argument('--toolset', metavar='TOOLSET',
- type=ToolchainType.parse,
- help='toolset to use')
parser.add_argument('--subdir', metavar='DIR',
help='relative project directory path')
parser.add_argument('cmake_args', nargs='*', metavar='CMAKE_ARG', default=[],
@@ -53,7 +49,7 @@ def build_ci(dirs, argv=None):
platform=dirs.get_platform(),
configuration=dirs.get_configuration(),
boost_dir=args.boost_dir or dirs.get_boost_dir(),
- toolset=args.toolset,
+ toolset=dirs.get_toolset(),
cmake_args=dirs.get_cmake_args() + args.cmake_args)
build(params)
diff --git a/project/ci/dirs.py b/project/ci/dirs.py
index bda4360..33bd667 100644
--- a/project/ci/dirs.py
+++ b/project/ci/dirs.py
@@ -11,6 +11,7 @@ from project.boost.version import Version
from project.ci.appveyor.generator import Generator, Image
from project.configuration import Configuration
from project.platform import Platform
+from project.toolchain import ToolchainType
from project.utils import env
@@ -37,6 +38,11 @@ class Dirs(abc.ABC):
def this_one(self):
pass
+ def get_toolset(self):
+ if 'toolset' in os.environ:
+ return ToolchainType.parse(os.environ['toolset'])
+ return None
+
@abc.abstractmethod
def get_platform(self):
pass