c++gn

`gn gen` gives `ERROR Need exactly one build directory to generate`


I was trying to follow google skia official build guide. The only thing i managed to do was clone skia from github. I don't understand need of deepot_tools. Then I tried to used GN but it gives me following error :

C:\Users\aslaf\skia>gn gen out/Shared --args='is_official_build=true is_component_build=true'

ERROR Need exactly one build directory to generate.
I expected something more like "gn gen out/foo"
You can also see "gn help gen"

I feel helpless. Maybe there exist person that has compiled skia on windows and could share some hints.


Solution

  • You seem to run it in Windows Command Prompt that is not able to handle single quotation marks. gn gets the four arguments:

    gen
    out/Shared
    --args='is_official_build=true
    is_component_build=true'
    

    Therefore it treats out/Shared and is_component_build=true' as two output directories. Try this

    gn gen out/Shared --args="is_official_build=true is_component_build=true"
    

    Or

    gn gen out/Shared "--args=is_official_build=true is_component_build=true"
    

    Or wrtie the file out/Shared/args.gn:

    is_official_build=true 
    is_component_build=true
    

    and run

    gn gen out/Shared