diff --git a/docs/cmake-toml.md b/docs/cmake-toml.md index 27d4e32..1b7aea7 100644 --- a/docs/cmake-toml.md +++ b/docs/cmake-toml.md @@ -72,7 +72,7 @@ unix = "UNIX" bsd = "CMAKE_SYSTEM_NAME MATCHES \"BSD\"" linux = "CMAKE_SYSTEM_NAME MATCHES \"Linux\"" gcc = "CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" OR CMAKE_C_COMPILER_ID STREQUAL \"GNU\"" -clang = "CMAKE_CXX_COMPILER_ID MATCHES \"Clang\" OR CMAKE_C_COMPILER_ID MATCHES \"Clang\"" +clang = "(CMAKE_CXX_COMPILER_ID MATCHES \"Clang\" AND NOT CMAKE_CXX_COMPILER_FRONTEND_VARIANT MATCHES \"^MSVC$\") OR (CMAKE_C_COMPILER_ID MATCHES \"Clang\" AND NOT CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES \"^MSVC$\")" msvc = "MSVC" root = "CMKR_ROOT_PROJECT" x64 = "CMAKE_SIZEOF_VOID_P EQUAL 8" diff --git a/src/project_parser.cpp b/src/project_parser.cpp index 5c4220a..c26b1ef 100644 --- a/src/project_parser.cpp +++ b/src/project_parser.cpp @@ -265,7 +265,8 @@ Project::Project(const Project *parent, const std::string &path, bool build) : p conditions["bsd"] = R"cmake(CMAKE_SYSTEM_NAME MATCHES "BSD")cmake"; conditions["linux"] = conditions["lunix"] = R"cmake(CMAKE_SYSTEM_NAME MATCHES "Linux")cmake"; conditions["gcc"] = R"cmake(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")cmake"; - conditions["clang"] = R"cmake(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Clang")cmake"; + conditions["clang"] = + R"cmake((CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_FRONTEND_VARIANT MATCHES "^MSVC$") OR (CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "^MSVC$"))cmake"; conditions["msvc"] = R"cmake(MSVC)cmake"; conditions["root"] = R"cmake(CMKR_ROOT_PROJECT)cmake"; conditions["x64"] = R"cmake(CMAKE_SIZEOF_VOID_P EQUAL 8)cmake";