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: allow disabling the intermediate objects target (cryptopp-object). #357

Merged

Conversation

HeinrichJanzing
Copy link

Targets with only object inputs do not work correctly with some
generators (like Xcode, see issue #355). Defining these directly in
terms of the source code files (rather than a reused set of object
files) allows correct builds in such cases. This can now be controlled
through a new option USE_INTERMEDIATE_OBJECTS_TARGET which defaults to
ON.

…ct).

Targets with only object inputs do not work correctly with some
generators (like Xcode, see issue weidai11#355). Defining these directly in
terms of the source code files (rather than a reused set of object
files) allows correct builds in such cases. This can now be controlled
through a new option USE_INTERMEDIATE_OBJECTS_TARGET which defaults to
ON.
@noloader
Copy link
Collaborator

noloader commented Jan 5, 2017

@HeinrichJanzing,

Please forgive my ignorance. What targets are you having trouble with? The expected Crypto++ artifacts are libcryptopp.a, libcryptopp.so and cryptest.exe. I believe Cmake provides all three.

@HeinrichJanzing
Copy link
Author

They are indeed defined but in my experience, when using Xcode as the generator, they are never actually built, as described in the referenced issue #355. Both library targets fail to result in an actual library subsequently causing the cryptest.exe artifact to fail to build as well.

@noloader
Copy link
Collaborator

noloader commented Jan 5, 2017

Both library targets fail to result in an actual library subsequently causing the cryptest.exe artifact to fail to build as well.

OK, thanks.

I think this is why Wei provided adhoc.ccp.proto. It predates Xcode, so I'm guessing it was added for Borland or Sun Studio or Metrowerks or some other old IDE.

What I am thinking... Can you add a Cmake recipe for Xcode that:

  1. copies adhoc.ccp.proto to adhoc.ccp
  2. adds the source file adhoc.ccp to the Xocde library targets?

My apologies for not doing it. I know very little about Cmake, and I really struggle with it.

@HeinrichJanzing
Copy link
Author

@noloader To trick Xcode (and possibly other generators) into producing a library I need a source file I can add to a target with zero side-effects. The adhoc.cpp.proto file appears to have two purposes, neither of which I really understand, though it does seem that its inclusion into a target would have side effects. I could use CMake to create such an empty source file inside the build folder. It would obviously be a bit of a hack but it would

  1. Avoid the issue for others without them having to find out about an (at first sight) seemingly unrelated build option.
  2. Not have any undesired side-effects other than the creation of the empty source file in the build folder.

@noloader noloader merged commit 89facf5 into weidai11:master Jan 12, 2017
@noloader
Copy link
Collaborator

Merged. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants