Simplify default conditions

It was JustMagic's idea to add 'lunix'
vcpkg-wip
Duncan Ogilvie 4 years ago
parent 220dec6bbb
commit c4673d59e2

@ -259,10 +259,11 @@ CMake::CMake(const std::string &path, bool build) {
} }
// Reasonable default conditions (you can override these if you desire) // Reasonable default conditions (you can override these if you desire)
conditions["win32"] = conditions["windows"] = conditions["win"] = "WIN32"; conditions["windows"] = R"cmake(WIN32)cmake";
conditions["macos"] = conditions["macosx"] = conditions["osx"] = conditions["mac"] = R"cond("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")cond"; conditions["macos"] = R"cmake("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")cmake";
conditions["unix"] = "UNIX"; conditions["unix"] = R"cmake(UNIX)cmake";
conditions["linux"] = R"cond("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")cond"; conditions["bsd"] = R"cmake("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")cmake";
conditions["linux"] = conditions["lunix"] = R"cmake("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")cmake";
if (toml.contains("conditions")) { if (toml.contains("conditions")) {
auto conds = toml::find<decltype(conditions)>(toml, "conditions"); auto conds = toml::find<decltype(conditions)>(toml, "conditions");

@ -8,10 +8,10 @@ custom = "CUSTOM"
[target.example] [target.example]
type = "executable" type = "executable"
sources = ["src/main.cpp"] sources = ["src/main.cpp"]
win32.sources = ["src/win32.cpp"] windows.sources = ["src/windows_specific.cpp"]
cmake-after = "message(STATUS cmake-after)" cmake-after = "message(STATUS cmake-after)"
win32.cmake-after = "message(STATUS win32-after)" windows.cmake-after = "message(STATUS win32-after)"
unix.cmake-after = "message(STATUS unix-after)"
macos.cmake-after = "message(STATUS macos-after)" macos.cmake-after = "message(STATUS macos-after)"
custom.cmake-after = "message(STATUS custom-after)" linux.cmake-after = "message(STATUS linux-after)"
linux.cmake-after = "message(STATUS linux-after)" unix.cmake-after = "message(STATUS unix-after)"
custom.cmake-after = "message(STATUS custom-after)"
Loading…
Cancel
Save