Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg-cmake] Failed when using vcpkg-cmake-configure to build uwp triples #19818

Closed
JackBoosY opened this issue Aug 31, 2021 · 2 comments
Closed
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@JackBoosY
Copy link
Contributor

JackBoosY commented Aug 31, 2021

When I switch vcpkg-configure-cmake to vcpkg-cmake-configure and build uwp triplet, I encounter the following error:

CMake Error at F:/vcpkg/downloads/tools/cmake-3.21.1-windows/cmake-3.21.1-windows-i386/share/cmake-3.21/Modules/CMakeTestFortranCompiler.cmake:54 (message):
  The Fortran compiler

    "F:/vcpkg/downloads/tools/msys2/77d32abdefb8691a/mingw64/bin/gfortran.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: F:/vcpkg/buildtrees/blas-reference/x64-uwp-dbg/CMakeFiles/CMakeTmp
    
    Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTC_2ce14 && 
    Microsoft Visual Studio 2017 Version 15.0.28307.1622.
    Copyright (C) Microsoft Corp. All rights reserved.
    
    Some errors occurred during migration. For more information, see the migration report:
    F:\vcpkg\buildtrees\blas-reference\x64-uwp-dbg\CMakeFiles\CMakeTmp\UpgradeLog.htm
    
    Invalid project
    
    Use:
    devenv  [solutionfile | projectfile | anyfile.ext]  [switches]
    
    The first argument for devenv is usually a solution file or project file.
    You can also use any other file as the first argument if you want to have the
    file open automatically in an editor. When you enter a project file, the IDE
    looks for an .sln file with the same base name as the project file in the
    parent directory for the project file. If no such .sln file exists, then the
    IDE looks for a single .sln file that references the project. If no such single
    .sln file exists, then the IDE creates an unsaved solution with a default .sln
    file name that has the same base name as the project file.
    
    Command line builds:
    devenv solutionfile.sln /build [ solutionconfig ] [ /project projectnameorfile [ /projectconfig name ] ]
    Available command line switches:
    
    /Build		Builds the solution or project with the specified solution
    		configuration. For example "Debug". If multiple platforms
    		are possible, the configuration name must be enclosed in quotes
    		and contain platform name. For example: "Debug|Win32".
    /Clean		Deletes build outputs.
    /Command	Starts the IDE and executes the command.
    /Deploy		Builds and then deploys the specified build configuration.
    /Edit		Opens the specified files in a running instance of this
    		application. If there are no running instances, it will
    		start a new instance with a simplified window layout.
    /LCID		Sets the default language in the IDE for the UI.
    /Log		Logs IDE activity to the specified file for troubleshooting.
    /NoVSIP		Disables the VSIP developer's license key for VSIP testing.
    /Out		Appends the build log to a specified file.
    /Project	Specifies the project to build, clean, or deploy.
    		Must be used with /Build, /Rebuild, /Clean, or /Deploy.
    /ProjectConfig	Overrides the project configuration specified in the solution
    		configuration. For example "Debug". If multiple platforms are
    		possible, the configuration name must be enclosed in quotes
    		and contain platform name. For example: "Debug|Win32".
    		Must be used with /Project.
    /Rebuild	Cleans and then builds the solution or project with the
    		specified configuration.
    /ResetSettings	Restores the IDE's default settings, optionally resets to
    		the specified VSSettings file.
    /ResetSkipPkgs	Clears all SkipLoading tags added to VSPackages.
    /Run		Compiles and runs the specified solution.
    /RunExit	Compiles and runs the specified solution then closes the IDE.
    /SafeMode	Launches the IDE in safe mode loading minimal windows.
    /Upgrade	Upgrades the project or the solution and all projects in it.
    		A backup of these files will be created as appropriate.  Please
    		see Help on 'Visual Studio Conversion Wizard' for more
    		information on the backup process.
    
    Product-specific switches:
    
    /debugexe	Open the specified executable to be debugged. The remainder of 
    		the command line is passed to this executable as its arguments.
    /diff		Compares two files.  Takes four parameters:
    		SourceFile, TargetFile, SourceDisplayName(optional),
    		TargetDisplayName(optional)
    /TfsLink	Opens Team Explorer and launches a viewer for the 
    		provided artifact URI if one is registered.
    /useenv		Use PATH, INCLUDE, LIBPATH, and LIB environment variables
    		instead of IDE paths for VC++ builds.
    
    To attach the debugger from the command line, use:
    	VsJITDebugger.exe -p <pid>
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)

The sln file is exist and the build command is correct, but the upgrade log shows:

cmTC_742bc.vfproj: The application which this project type is based on was not found. Please try this link for further information: https://go.microsoft.com/fwlink/?LinkId=660751&projecttype=6989167D-11E4-40FE-8C1A-2192A86A7E90

According to the sln file and the vfproj file content, I think some configuration is wrong.
The behavor should be same as vcpkg_configure_cmake.

@JackBoosY JackBoosY added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Aug 31, 2021
@JackBoosY
Copy link
Contributor Author

JackBoosY commented Sep 1, 2021

Here

elseif(targetting_uwp)
# Ninja and MSBuild have many differences when targetting UWP, so use MSBuild to maximize existing compatibility
set(ninja_can_be_used OFF)
endif()

The mandatory setting to use msbuild instead of ninja when building uwp caused this issue.

I can confirm set ninja_can_be_used to ON can solve this issue.

@Adela0814
Copy link
Contributor

I'm not able to repro this issue using the latest vcpkg, this should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

No branches or pull requests

3 participants