Discussion:
[cmake-developers] CMake, Ninja and Clang on windows?
Tobias Hunger
2018-11-06 10:57:26 UTC
Permalink
Hi CMake Developers,

we are currently trying to support Clang (without the -cl;-) on
Windows. This fails since CMake adds extra compiler flags to the
command line which are not in the expected format.

Stackoverflow[1] suggests to set CMAKE_SYSTEM_NAME to "Generic" to
stop that from happening.

The blog post[2] referenced by StackOverflow suggests setting
CMAKE_C_FLAGS and CMAKE_CXX_FLAGS to TRUE.

Both approaches seem like big hammers to me. Are there better ways to
get this going that will have less potential side effects?

Best Regards,
Tobias

[1]: https://stackoverflow.com/questions/46553436/building-with-cmake-ninja-and-clang-on-windows#46593308
[2]: https://metricpanda.com/rival-fortress-update-27-compiling-with-clang-on-windows
--
Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers
Jean-Michaël Celerier
2018-11-06 12:47:10 UTC
Permalink
Hi,
to do this I currently use the following cross-compiling toolchain :
https://github.com/mstorsjo/llvm-mingw

I was able to build Qt (except webstuff since I don't use them) and a large
CMake-based project with it for instance.
Maybe it can be useful ?

Best,

-------
Jean-Michaël Celerier
http://www.jcelerier.name
Post by Tobias Hunger
Hi CMake Developers,
we are currently trying to support Clang (without the -cl;-) on
Windows. This fails since CMake adds extra compiler flags to the
command line which are not in the expected format.
Stackoverflow[1] suggests to set CMAKE_SYSTEM_NAME to "Generic" to
stop that from happening.
The blog post[2] referenced by StackOverflow suggests setting
CMAKE_C_FLAGS and CMAKE_CXX_FLAGS to TRUE.
Both approaches seem like big hammers to me. Are there better ways to
get this going that will have less potential side effects?
Best Regards,
Tobias
https://stackoverflow.com/questions/46553436/building-with-cmake-ninja-and-clang-on-windows#46593308
https://metricpanda.com/rival-fortress-update-27-compiling-with-clang-on-windows
--
Powered by www.kitware.com
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
https://cmake.org/mailman/listinfo/cmake-developers
Brad King
2018-11-06 14:03:37 UTC
Permalink
Post by Tobias Hunger
we are currently trying to support Clang (without the -cl;-) on
Windows. This fails since CMake adds extra compiler flags to the
command line which are not in the expected format.
Clang with a GNU-like command targeting the MSVC ABI is not supported.
See this issue:

https://gitlab.kitware.com/cmake/cmake/issues/16439

The MSVC-like command-line (with -cl) works fine.

-Brad
--
Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers
Loading...