Git Product home page Git Product logo

Comments (7)

dunhor avatar dunhor commented on June 13, 2024 1

This is probably not the correct approach

Right. The problem is not with the target compiler, but with the target generator. MSVC+Ninja works correctly; it's only when using MSBUILD as the generator that this issue presents itself

from wil.

dunhor avatar dunhor commented on June 13, 2024

Can you share what commands you ran and the outputs you got?

from wil.

asklar avatar asklar commented on June 13, 2024
F:\wil> scripts\init.cmd -c msvc -g msbuild
The system cannot find the drive specified.
The system cannot find the drive specified.
Using compiler....... msvc
Using architecture... x64
Using build type..... debug
Using build root..... F:\wil\build\msvc64debug

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.25300.0 to target Windows 10.0.
-- The C compiler identification is MSVC 19.35.32215.0
-- The CXX compiler identification is MSVC 19.35.32215.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: F:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: F:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Feeds used:
  C:\Users\asklar\.nuget\packages\
  https://api.nuget.org/v3/index.json
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
  C:\temp



Attempting to gather dependency information for package 'Microsoft.Windows.CppWinRT.2.0.221121.5' with respect to project 'F:\wil\build\msvc64debug\packages', targeting 'Any,Version=v0.0'
Gathering dependency information took 258 ms
Attempting to resolve dependencies for package 'Microsoft.Windows.CppWinRT.2.0.221121.5' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.Windows.CppWinRT.2.0.221121.5'
Resolved actions to install package 'Microsoft.Windows.CppWinRT.2.0.221121.5'
Retrieving package 'Microsoft.Windows.CppWinRT 2.0.221121.5' from 'C:\Users\asklar\.nuget\packages\'.
Adding package 'Microsoft.Windows.CppWinRT.2.0.221121.5' to folder 'F:\wil\build\msvc64debug\packages'
Added package 'Microsoft.Windows.CppWinRT.2.0.221121.5' to folder 'F:\wil\build\msvc64debug\packages'
Successfully installed 'Microsoft.Windows.CppWinRT 2.0.221121.5' to F:\wil\build\msvc64debug\packages
Executing nuget actions took 453 ms
CMake Error at tests/CMakeLists.txt:44 (if):
  if given arguments:

    "STREQUAL" "RelWithDebInfo"

  Unknown arguments specified


-- Configuring incomplete, errors occurred!
See also "F:/wil/build/msvc64debug/CMakeFiles/CMakeOutput.log".

from wil.

dunhor avatar dunhor commented on June 13, 2024

Thanks! Looks like this is as I suspected.

Your original comment suggested that you were getting errors with the init_all.cmd script - is that still the case?

from wil.

asklar avatar asklar commented on June 13, 2024

yes, init-all fails for me because I don't have/use clang :)

from wil.

dunhor avatar dunhor commented on June 13, 2024

Gotcha. So, in that case, it sounds like this should just be scoped down to running init.cmd with MSBuild as the generator

from wil.

citelao avatar citelao commented on June 13, 2024

I have a mitigation for this---

Wrap the if conditions that check CMAKE_BUILD_TYPE (on ~line 45 and ~75) in checks for Clang:

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    # For some unknown reason, 'RelWithDebInfo' compiles with '/Ob1' as opposed to '/Ob2' which prevents inlining of
    # functions not marked 'inline'. The reason we prefer 'RelWithDebInfo' over 'Release' is to get debug info, so manually
    # revert to the desired (and default) inlining behavior as that exercises more interesting code paths
    if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
        # TODO: This is currently blocked by an apparent Clang bug: https://github.com/llvm/llvm-project/issues/59690
        # replace_cxx_flag("/Ob1" "/Ob2")
    endif() 
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
        set(DEBUG_BUILD TRUE)
        set(HAS_DEBUG_INFO TRUE)
    elseif(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
        set(HAS_DEBUG_INFO TRUE)
    endif()
endif()

This is probably not the correct approach (CMAKE_BUILD_TYPE should probably have a value during msbuild), but it unblocked me.

from wil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.