Is it possible to build Chromium with cl compiler?

255 views
Skip to first unread message

aari...@gmail.com

unread,
Dec 22, 2022, 4:30:49 AM12/22/22
to Chromium-dev
I successfully built Chromium with the default settings on Windows. I see clang-cl was used to compile source files. When I tried to use "is_clang=false" gn argument, build failed because of many -Wno-unused-const-variable or -Wno-unused-function compiler options which cl doesn't understand, and I believe there are many other such options. These options are added unconditionally in many gn build files.

Is building with Microsoft's cl compiler supported now? I couldn't find any info now, but I remember years ago that was possible. Some old posts hint that actually was.

Nico Weber

unread,
Dec 22, 2022, 9:50:11 AM12/22/22
to aari...@gmail.com, Chromium-dev
It's not supported. There's supposed to be an error message along the lines of "this is not supported" if you try.

On Thu, Dec 22, 2022, 4:31 AM aari...@gmail.com <aari...@gmail.com> wrote:
I successfully built Chromium with the default settings on Windows. I see clang-cl was used to compile source files. When I tried to use "is_clang=false" gn argument, build failed because of many -Wno-unused-const-variable or -Wno-unused-function compiler options which cl doesn't understand, and I believe there are many other such options. These options are added unconditionally in many gn build files.

Is building with Microsoft's cl compiler supported now? I couldn't find any info now, but I remember years ago that was possible. Some old posts hint that actually was.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/baa5278b-7a08-4676-a18f-7a475edb4061n%40chromium.org.

aari...@gmail.com

unread,
Dec 22, 2022, 10:07:57 AM12/22/22
to Chromium-dev, Nico Weber, Chromium-dev, aari...@gmail.com
Thank you, noted.

As for the error messages, there are no "not supported" errors, neither while generating a project nor while building it.
"gn gen" finishes just fine:
path>gn gen --ide=vs out\VS --args="is_clang=false"
Generating Visual Studio projects took 24161ms
Done. Made 18504 targets from 3196 files in 50632ms

And build fails because of compiler options:
path>autoninja -C out\VS chrome
...
[162/56098] CXX obj/skia/skia_opts_avx/SkOpts_avx.obj
FAILED: obj/skia/skia_opts_avx/SkOpts_avx.obj
...
cl : Command line warning D9025 : overriding '/std:c++17' with '/std:c++20'
cl : Command line error D8021 : invalid numeric argument '/Wno-c++17-extensions'
[163/56098] CXX obj/skia/skia_opts_sse3/SkOpts_ssse3.obj
FAILED: obj/skia/skia_opts_sse3/SkOpts_ssse3.obj
...
cl : Command line warning D9025 : overriding '/std:c++17' with '/std:c++20'
cl : Command line error D8021 : invalid numeric argument '/Wno-c++17-extensions'

Nico Weber

unread,
Dec 22, 2022, 10:39:38 AM12/22/22
to aari...@gmail.com, Chromium-dev
This error is supposed to fire: https://source.chromium.org/chromium/chromium/src/+/main:base/compiler_specific.h;l=11?q=Compiler.specific&ss=chromium

We should probably add a gn time assert as well, thanks for the suggestion.
Reply all
Reply to author
Forward
0 new messages