Trouble setting clang location on windows build

359 views
Skip to first unread message

Rosculescu Ciprian

unread,
Aug 7, 2021, 9:01:35 PM8/7/21
to skia-discuss
Hello
I have downloaded skia from git and ran the python2 tools/git-sync-deps so now it was time to generate the build files
There is an issue with building on windows in that the clang_win variable cannot be set using --args
To generate some build files i can run thos command:
bin\gn gen out\Debug --args="is_official_build=false" 
When is try to run bin\gn gen out\Debug --args='is_official_build=true'  is get the error message "Strings are delimited by " characters, not apostrophes.". Because of this i cannot see how can i set the clang_win variable
I have tried bin\gn gen out\Debug --args="is_official_build=false clang_win=""C:\Program Files\LLVM""" and i get the following error "Need exactly one build directory to generate.". Any combinations of ' and " have resulted in one of these message. 
I suppose i could manually insert clang_win in args.gn however this is not the standard way as far as i know and the toolchain.ninja file is set to visual studio
Any suggestions are welcomed

Than you

Projectitis

unread,
Aug 7, 2021, 11:22:01 PM8/7/21
to skia-discuss
I use clang on windows to build skia. It took my many days of trying, but I finally got it working how I wanted.
This is a snippet from my debug build script. Notice that you need to escape all the double-quotes and all the backslashes in your paths and args. Hope it helps you:

cd skia
bin/gn gen out/x64-debug --args="is_debug=true is_official_build=false target_cpu = \"x64\" win_vc=\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\" clang_win=\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\" extra_cflags=[\"/MTd\""
ninja skia -C out/x64-debug


Cheers,
Peter

Rosculescu Ciprian

unread,
Aug 8, 2021, 5:03:14 AM8/8/21
to skia-discuss
Thank you Peter, this was the solution i was looking for.
Reply all
Reply to author
Forward
0 new messages