Skip to content

Path to root appended on flags when building with gmake2 and MSVC #2489

@luxploit

Description

@luxploit

What seems to be the problem?
When using gmake2 as the output generator, then trying to build it with MSVC by manually setting CXX=cl (which I'm putting into path through this https://github.com/nathan818fr/vcvars-bash/blob/main/vcvarsall.sh), all flags will get the root path appended to them (eg. C:/Program Files/Git (in my case I'm using the MinGW environment that ships with git and have manually added gnumake to it)

What did you expect to happen?
It just builds

What have you tried so far?
I've tried to look through the generated makefiles to see why this happens, however it's not clear to me why this happens. I've also tried using gmake2, gmake and gmakelegacy but all produce the same bug

How can we reproduce this?
This should go for any premake5 project (Note you require MSVC installed aswell has have wget and gnumake in your msys2/mingw environment

wget https://raw.githubusercontent.com/nathan818fr/vcvars-bash/refs/heads/main/vcvarsall.sh
chmod +x vcvarsall.sh
eval "(./vcvarsall.sh amd64)"
premake5 gmake2
CXX=cl make
  • Visual Studio 2022 (vs2022)
  • Visual Studio 2019 (vs2019)
  • Visual Studio 2017 (vs2017)
  • Visual Studio 2015 (vs2015)
  • Visual Studio 2012 (vs2012)
  • Visual Studio 2010 (vs2010)
  • Visual Studio 2008 (vs2008)
  • Visual Studio 2005 (vs2005)
  • GNU Makefile (gmake)
  • GNU Makefile Legacy (gmakelegacy)
  • XCode (xcode)
  • Codelite
  • Other (Please list below)

What version of Premake are you using?
premake5 (Premake Build Script Generator) 5.0.0-beta2

Sample log output:

streisky@desertstorm MINGW64 ~/Desktop/Source Code/zeroproxy-new (master)
$ CXX=cl make client-iw9
==== Building asmjit (debug_win32) ====
a64assembler.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35209 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl : Command line warning D9002 : ignoring unknown option '-MF'
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/DDEBUG', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/DDEBUG' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/D_DEBUG', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/D_DEBUG' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/DASMJIT_STATIC', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/DASMJIT_STATIC' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/Gm-', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/Gm-' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/MP', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/MP' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/Od', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/Od' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/MTd', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/MTd' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/Z7', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/Z7' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/W0', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/W0' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/EHsc', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/EHsc' ignored
cl : Command line warning D9024 : unrecognized source file type 'C:/Program Files/Git/MD', object file assumed
cl : Command line warning D9027 : source file 'C:/Program Files/Git/MD' ignored
cl : Command line warning D9024 : unrecognized source file type '../../build/obj/Win32/Debug/asmjit/a64assembler.d', object file assumed
cl : Command line warning D9027 : source file '../../build/obj/Win32/Debug/asmjit/a64assembler.d' ignored

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions