+ if target != builder.config.build {
+ if target.contains("netbsd") {
+ cfg.define("CMAKE_SYSTEM_NAME", "NetBSD");
+ } else if target.contains("freebsd") {
+ cfg.define("CMAKE_SYSTEM_NAME", "FreeBSD");
+ } else if target.contains("windows") {
+ cfg.define("CMAKE_SYSTEM_NAME", "Windows");
+ }
+ // When cross-compiling we should also set CMAKE_SYSTEM_VERSION, but in
+ // that case like CMake we cannot easily determine system version either.
+ //
+ // Since, the LLVM itself makes rather limited use of version checks in
+ // CMakeFiles (and then only in tests), and so far no issues have been
+ // reported, the system version is currently left unset.
+ }
+