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

Fix build with cmake under windows. #305

Merged
merged 1 commit into from
Dec 4, 2015
Merged

Conversation

correa
Copy link
Contributor

@correa correa commented Dec 2, 2015

Fix build with MSVC, let cmake manage boost selection settings.

@correa
Copy link
Contributor Author

correa commented Dec 2, 2015

This fixes issue #181 "Cant build libtorrent with Visual Studio 2015.Getting linking error."

add_definitions(-D_WIN32_WINNT=0x0600)
# prevent winsock1 to be included
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DWIN32_LEAN_AND_MEAN -DTORRENT_EXPORT_EXTRA)
Copy link
Owner

Choose a reason for hiding this comment

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

this define should only be added when building tests. is there a way to distinguish that? it's really not a good idea to include it for production builds, it exposes lots of internal functions and classes.

@correa
Copy link
Contributor Author

correa commented Dec 3, 2015

Without TORRENT_EXPORT_EXTRA there is a link problem in cpuid.cpp mmx function detection in the user code. Am I doing something wrong?

@arvidn
Copy link
Owner

arvidn commented Dec 3, 2015

what's the error?

@arvidn
Copy link
Owner

arvidn commented Dec 3, 2015

the appveyor build of the examples, with shared linking, is supposed to catch issues like that. Since that's passing, it's possible there's a configuration issue in the cmake files causing it too

Fix build with MSVC, let cmake manage boost selection settings.
@correa
Copy link
Contributor Author

correa commented Dec 3, 2015

I've updated the patch, thanks for noticing it. It was defined in user code as well, probably what caused the error. Removed from both and it builds fine.

arvidn added a commit that referenced this pull request Dec 4, 2015
Fix build with cmake under windows.
@arvidn arvidn merged commit 595125d into arvidn:master Dec 4, 2015
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.

2 participants