From 0ad425c1aec96756309361611cd2003c15afbd36 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 19 Jan 2021 00:14:53 +0300 Subject: project.cmake: --toolset auto shouldn't set any compiler flags --- project/cmake/build.py | 2 +- project/cmake/toolchain.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/project/cmake/build.py b/project/cmake/build.py index d2c2070..ee5772e 100644 --- a/project/cmake/build.py +++ b/project/cmake/build.py @@ -34,7 +34,7 @@ from project.toolchain import ToolchainType from project.utils import normalize_path, run, setup_logging -DEFAULT_PLATFORM = Platform.native() +DEFAULT_PLATFORM = None DEFAULT_CONFIGURATION = Configuration.DEBUG DEFAULT_TOOLSET = ToolchainType.AUTO diff --git a/project/cmake/toolchain.py b/project/cmake/toolchain.py index 7966192..32831b2 100644 --- a/project/cmake/toolchain.py +++ b/project/cmake/toolchain.py @@ -138,6 +138,12 @@ class Toolchain(abc.ABC): @staticmethod def detect(hint, platform, build_dir): if hint is ToolchainType.AUTO: + # If the platform wasn't specified, auto-detect everything. + # There's no need to set -mXX flags, etc. + if platform is None: + return Auto() + # If a specific platform was requested, we might need to set some + # CMake/compiler flags. if on_windows(): # We need to specify the -A parameter. This might break if # none of the Visual Studio generators are available, but the -- cgit v1.2.3