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

cmake file overwrites existing CMAKE_STATIC_LINKER_FLAGS #6098

Closed
ssiloti opened this issue May 4, 2019 · 1 comment

Comments

@ssiloti
Copy link

commented May 4, 2019

What version of protobuf and what language are you using?
Version: 3.7.0
Language: C++

What operating system (Linux, Windows, ...) and version?
Windows 10

What runtime / compiler are you using (e.g., python version or gcc version)
msvc-14.2 (Visual Studio 2019)

What did you do?
Steps to reproduce the behavior:

  1. Configure with cmake using a non-default target arch, e.g. cmake -A Win32
  2. Build with Visual Studio

What did you expect to see
Build is successful

What did you see instead?

warning LNK4068: /MACHINE not specified; defaulting to x64
fatal error LNK1112: module machine type 'X86' conflicts with target
machine type 'x64'

Anything else we should know about your project / environment
The offending code is:

set(CMAKE_STATIC_LINKER_FLAGS /ignore:4221)

Which overwrites the value of CMAKE_STATIC_LINKER_FLAGS thus removing the /MACHINE parameter which was there. This line needs to append to the existing value rather than overwrite it.

Croydon added a commit to bincrafters/conan-protobuf that referenced this issue Aug 24, 2019
@Croydon

This comment has been minimized.

Copy link

commented Aug 25, 2019

I can confirm that this is a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.