aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/project
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-01-19 00:14:53 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-01-19 00:14:53 +0300
commit0ad425c1aec96756309361611cd2003c15afbd36 (patch)
tree487909d207bdd1daf9f70b5ba1315ce242df92c7 /project
parentproject.ci: add GitHub Actions (diff)
downloadcmake-common-0ad425c1aec96756309361611cd2003c15afbd36.tar.gz
cmake-common-0ad425c1aec96756309361611cd2003c15afbd36.zip
project.cmake: --toolset auto shouldn't set any compiler flags
Diffstat (limited to 'project')
-rw-r--r--project/cmake/build.py2
-rw-r--r--project/cmake/toolchain.py6
2 files changed, 7 insertions, 1 deletions
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