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

VS2015 default configuration appears wrong #2134

Closed
mikkelfj opened this issue Jul 31, 2017 · 14 comments
Closed

VS2015 default configuration appears wrong #2134

mikkelfj opened this issue Jul 31, 2017 · 14 comments
Labels
OS:windows Winodows OS specific issues

Comments

@mikkelfj
Copy link

It appears that a MSVC build on AppVeyor does not work with the defualt configuration "debug|x86".
I could play around with config parameters, but a CMake build does not require any additional arguments.

Meson appveyor file and output
https://github.com/dvidelabs/flatcc/blob/meson/appveyor.yml
https://ci.appveyor.com/project/dvidelabs/flatcc/build/win%23528/job/hxiggovps87cpar4

similar CMake appveyor.yml file
https://github.com/dvidelabs/flatcc/blob/master/appveyor.yml

"c:\projects\flatcc\build\MSVC\flatcc.sln" (default target) (1) ->
       (ValidateSolutionConfiguration target) -> 
         c:\projects\flatcc\build\MSVC\flatcc.sln.metaproj : error MSB4126: The specified
 solution configuration "debug|x86" is invalid. Please specify a valid solution
 configuration using the Configuration and Platform properties
 (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU")
 or leave those properties blank to use the default solution configuration. 
[c:\projects\flatcc\build\MSVC\flatcc.sln]
@santagada
Copy link

you set in the appveyor.yml x86 and x64 and debug and release, I don't know about meson but can't you check the .sln to see which configurations are actually set in the solution? if you post the sln file generated I can take a look. I'm guessing that meson by default maybe only creates configurations for the host (which might be x64).

@mikkelfj
Copy link
Author

I don't have access to the AppVeyor sln file, but I have attached one generated on my Mac. Otherwise you can generate one from the repo using

mkdir -p build/MSVC; cd build/MSVC; meson ../.. --backend=vs2015 --buildtype=debug

flatcc.sln.zip

@mikkelfj
Copy link
Author

It looks like your assumption is right. I don't see any x86 in the file.

@mikkelfj
Copy link
Author

It seems that I don't have any if platform guards in the meson version of the AppVeyor file, but I do in CMake, so I will try make this change and report back.

@mikkelfj
Copy link
Author

The thing is, in CMake you have -G "Visual Studio 14 2015" or -G "Visual Studio 14 2015 Win64"
with an optional Win64 at the end. I'm not sure what the equivalent would be in Meson, hence a plaform guard would make no difference.

@mikkelfj
Copy link
Author

Removing the x86 arch starts the build - but I would like to know if it's possible to target both x86 and x64 without crosscompiling, and the same goes for travis/ninja backends - though for travis I have not set that up with CMake either.

As to the results of compiling without x86 I am now getting two errors both related to not finding flatcc.lib

(I disabled parallel:true in AppVeyor but it changed nothing)

https://ci.appveyor.com/project/dvidelabs/flatcc/build/win%23532/job/o4l8qu6xqwhen1lg

  • line 297 LINK : fatal error LNK1104: cannot open file 'flatcc.lib' [c:\projects\flatcc\build\MSVC\[email protected]]

I build two libraries: libflatcc (larger lib) and libflatccrt (smaller runtime lib). The flatcc.exe app fails to link with libflatcc (the larger lib). I'm not sure about the runtime lib - since so much depends on flatcc.exe being built first.

For comparision, here is a successful AppVeyor CMake driven x64 debug build although it might not build all the tests due to CMake limitations.
https://ci.appveyor.com/project/dvidelabs/flatcc/build/win%23527/job/v05oor7eqaqp6uid

and here is a successful travis build of the meson branch:
https://travis-ci.org/dvidelabs/flatcc/jobs/259276505

@nirbheek nirbheek added the OS:windows Winodows OS specific issues label Aug 4, 2017
@NickeZ
Copy link
Contributor

NickeZ commented May 21, 2018

I'm sure I'm way to late since this is about one year later. but the answer to your question is probably to load the correct environment variables from visual studio for x86 before running meson:

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86

See https://github.com/mesonbuild/meson/blob/master/.appveyor.yml#L101

@nirbheek
Copy link
Member

nirbheek commented Jun 3, 2018

@NickeZ is probably right, and yes, sorry about the late response :)

Closing this bug, please reopen if it's still an issue!

@nirbheek nirbheek closed this as completed Jun 3, 2018
@mikkelfj
Copy link
Author

mikkelfj commented Jun 4, 2018

That is the correct workaround - but it is painful compared to CMake that can do this automatically. However you can’t avoid vcvars anyway when testing multiple compiler versions.

I’ll leave this closed since you don’t seem to want to follow the CMake approach.

@nirbheek
Copy link
Member

nirbheek commented Jun 6, 2018

@mikkelfj you're looking for #2622.

@NickeZ
Copy link
Contributor

NickeZ commented Jun 6, 2018

Actually I think they are looking for #3382

@mikkelfj
Copy link
Author

mikkelfj commented Jun 6, 2018

Good, looking forward to it. Note that compilers all the way back to MSVC 2010 is important for retro testing C projects.

@nirbheek
Copy link
Member

nirbheek commented Jun 6, 2018

Actually I think they are looking for #3382

That's actually fundamentally broken, because it will do compiler checks with the wrong compiler and hence is quite likely to generate bad build files unless the project is very simple

@NickeZ
Copy link
Contributor

NickeZ commented Jun 6, 2018

My bad, I thought CMake could generate any backend on any platform. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS:windows Winodows OS specific issues
Projects
None yet
Development

No branches or pull requests

4 participants