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

Static lib compilation for UWP #26

Closed
wants to merge 2 commits into from

Conversation

simonferquel
Copy link

This is a very small addition with only a vcxproj for doing static lib compilation of Casablanca for UWP platform.
This produces safe to ignore warnings about static lib compilation with /ZW flag (it is safe because Casablanca does not expose public winrt types).

The motivation was to mix the benefits of using the native Windows http client (with its support for caching, prefetch and more), and the completeness of Casablanca Json serialization/deserialization (WinRT Json is somewhat basic, especially for long numbers handling), without paying for the whole Casablanca dll (saving bandwidth and memory consumption - especially in background agents).

@msftclas
Copy link

Hi @simonferquel, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@msftclas
Copy link

@simonferquel, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, MSBOT;

<DebugFileSuffix>d</DebugFileSuffix>
</PropertyGroup>
<PropertyGroup>
<TargetName>$(CppRestBaseFileName)140$(DebugFileSuffix)_uwp_$(CppRestSDKVersionFileSuffix)</TargetName>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import lib for the shared library cpprest140d_uwp_2_7.dll already has this name. I would prefer using different names here to minimize chances of mistaking the library type (import/static).
How about following a specific naming convention for static libs, say add _static suffix (cpprest140d_uwp_static_2_7.lib) or prepend the name with lib (libcpprest140d_uwp_2_7.lib).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some one suggested we can look at doing something similar to boost, http://www.boost.org/doc/libs/1_42_0/more/getting_started/windows.html#library-naming

If you are building a static library, use the lib prefix.
If the library is linking statically to the C++ standard library and compiler runtime support libraries, use s in the .lib name.
In this case, we are not linking statically to the runtime. so we can go with libcpprest140d_uwp_2_7.lib.
In future, if someone wants to add another version to link to the runtime statically, we can add _s to the name.
What do you think.

@kavyako
Copy link
Contributor

kavyako commented Dec 2, 2015

This change got merged to the development branch while I was merging something else. I will not revert it. Once we decide on the name, I can update the proj file with it.

@kavyako
Copy link
Contributor

kavyako commented Dec 7, 2015

I have modified the static lib name to libcpprest140d_uwp_2_7.lib. The change is in the development branch. Please reopen the thread if you disagree with the naming convention.

Thank you for contributing the changes.

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.

3 participants