Simplify default conditions

It was JustMagic's idea to add 'lunix'
vcpkg-wip
Duncan Ogilvie 3 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)
conditions["win32"] = conditions["windows"] = conditions["win"] = "WIN32";
conditions["macos"] = conditions["macosx"] = conditions["osx"] = conditions["mac"] = R"cond("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")cond";
conditions["unix"] = "UNIX";
conditions["linux"] = R"cond("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")cond";
conditions["windows"] = R"cmake(WIN32)cmake";
conditions["macos"] = R"cmake("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")cmake";
conditions["unix"] = R"cmake(UNIX)cmake";
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")) {
auto conds = toml::find<decltype(conditions)>(toml, "conditions");

@ -8,10 +8,10 @@ custom = "CUSTOM"
[target.example]
type = "executable"
sources = ["src/main.cpp"]
win32.sources = ["src/win32.cpp"]
windows.sources = ["src/windows_specific.cpp"]
cmake-after = "message(STATUS cmake-after)"
win32.cmake-after = "message(STATUS win32-after)"
unix.cmake-after = "message(STATUS unix-after)"
windows.cmake-after = "message(STATUS win32-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