error MSB4057: The target "v8" does not exist in the project
Asked Answered
F

3

2

I'm trying to build V8 as part of ArangoDB using the official build scripts and following the official Windows build instructions.

The compilation fails for all v8* targets (v8-build.bat):

msbuild All.sln /t:v8 /p:Configuration=Release /p:Platform=x64
msbuild All.sln /t:v8_libbase /p:Configuration=Release /p:Platform=x64
msbuild All.sln /t:v8_libplatform /p:Configuration=Release /p:Platform=x64

error MSB4057: The target "v8" does not exist in the project.

If I open the solution file in Visual Studio, it looks like this:

All.sln

I can build v8, v8_libbase and v8_libplatform just fine in VS.

  • Windows 7 64bit
  • Visual Studio 2013 Ultimate
  • Cygwin 2.2.0
  • cmake 3.3.1
Foreordain answered 18/8, 2015 at 17:1 Comment(0)
S
9

You can run

set MSBuildEmitSolution=1
msbuild All.sln /t:v8

Then search in the generated All.sln.metaproj file the exact target names (<Target Name="">) of all projects you want to build. v8 can have a name like _tools_\_gyp_\v8. After that you can build projects

msbuild All.sln /t:"_tools_\_gyp_\v8" /p:Configuration=Release /p:Platform=x64
Shend answered 3/3, 2016 at 20:25 Comment(2)
Thanks this helped perfectly. My Issue for other to know is that if your project is name "hello.world" The msbuild target is actually "hello_world"Weltpolitik
The replacement of "." with "_" got me too. Also there is no "Build" target only "Rebuild". e.g. /t:Hello_World:RebuildGrata
F
2

The correct way to specify a target/project if it's in a solution folder is:

msbuild all.sln /t:PATH\TO\PROJECT

But in case of (tools) and (gyp) it's simply not possible, because msbuild can't handle parentheses in the target parameter /t.

So either remove ( ) and specify the path like tools\gyp\v8, or get rid of the solution folders entirely. If the solution is flat, /t:v8 will work.

Unfortunately, both the wrapping of folder names with brackets as well as the generation of non-flat .sln are hardcoded in gyp, which generated my all.sln. There is no switch to control whether solution folders are created or not. It will create them if the target version of Visual Studio is known to support this kind of nesting.

Workaround: Force flat solution generation in gyp, see
https://github.com/arangodb/arangodb/commit/796d2d263db6271142d954c8c99b9dec0fbe75e9

Reported errors to Microsoft/msbuild and Google/gyp:

@dothebart and this post helped me a lot to figure it out, thank you!

Foreordain answered 19/8, 2015 at 20:5 Comment(0)
B
1

In VS2013 use

msbuild All.sln /p:Project=v8;Configuration=Release;Platform=x64
Bony answered 18/10, 2015 at 17:14 Comment(2)
I hurried - it's rebuild all solution.Bony
I'm not sure if this is an option.Foreordain

© 2022 - 2024 — McMap. All rights reserved.