Page MenuHomePhabricator

[CMake] Reland "Detect the compiler runtime and standard library"

Authored by phosek on May 18 2018, 3:53 PM.



Rather then requiring the user to specify runtime the compiler
runtime and C++ standard library, or trying to guess them which is
error-prone, use auto-detection by parsing the compiler link output.

Diff Detail

Event Timeline

phosek created this revision.May 18 2018, 3:53 PM
Herald added subscribers: Restricted Project, llvm-commits, mgorny. · View Herald TranscriptMay 18 2018, 3:53 PM

This got reverted because MSVC cl doesn't support --print-libgcc-file-name so the runtime check broke. Now we check if that option is supported prior to using it.

phosek updated this revision to Diff 147618.May 18 2018, 4:58 PM

So after testing this on Windows, I found out it was actually -### that's breaking. The problem is that I cannot use check_c_compiler_flag because -### breaks CMake so I have to use compiler detection instead, clang-cl also seems to be refusing both -### and -print-libgcc-file-name so disabling both on Windows. Let me know if you have any other idea on how to address this.

phosek updated this revision to Diff 147621.May 18 2018, 4:59 PM
phosek abandoned this revision.May 22 2018, 4:24 PM