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

Allow building with cmake (to ease building on windows), version 2 #29

Closed
wants to merge 4 commits into from

Conversation

vrabaud
Copy link
Contributor

@vrabaud vrabaud commented Feb 27, 2017

This is a small rewrite of #16 , mostly to simplify the windows support and modify less code.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

@vrabaud
Copy link
Contributor Author

vrabaud commented Feb 28, 2017

@trondn, I can take over this pull request until it's merged but I would need you to agree to the Contributor License Agreeement. Is that ok with you ?

@trondn
Copy link

trondn commented Feb 28, 2017

Sure :) (I don't know why the CLA check failed.. I've singed the CLA earlier..)

@vrabaud vrabaud closed this Feb 28, 2017
@vrabaud vrabaud reopened this Feb 28, 2017
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@vrabaud
Copy link
Contributor Author

vrabaud commented Feb 28, 2017

ok, @trondn, the error was on my side, sorry. As asked by the bot, please confirm that you are ok with me committing what you authored, and we are good to go ! Thx !

@trondn
Copy link

trondn commented Feb 28, 2017

Go for it :)

CMakeLists.txt Outdated
CHECK_LIBRARY_EXISTS(fastlz fastlz_compress "" HAVE_LIBFASTLZ)
CHECK_LIBRARY_EXISTS(quicklz qlz_compress "" HAVE_LIBQUICKLZ)

CHECK_CXX_SOURCE_COMPILES("int main(void) { return __builtin_expect(0, 1) ? 1 : 0; }"
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't the following be enough:

CHECK_CXX_SOURCE_COMPILES("int main(void) { return __builtin_expect(0, 1); }" HAVE_BUILTIN_EXPECT)

CMakeLists.txt Outdated
CHECK_CXX_SOURCE_COMPILES("int main(void) { return __builtin_expect(0, 1) ? 1 : 0; }"
HAVE_BUILTIN_EXPECT)

CHECK_CXX_SOURCE_COMPILES("int main(void) { return __builtin_ctzll(0) ? 1 : 0; }"
Copy link
Contributor

Choose a reason for hiding this comment

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

Same.

CMakeLists.txt Outdated

SET(SNAPPY_MAJOR 1)
SET(SNAPPY_MINOR 1)
SET(SNAPPY_PATCHLEVEL 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be PATCHLEVEL 4.

@Optiligence
Copy link

you can specify the version in the project command instead of manually setting it
SOVERSION will then be set automatically and WRITE_BASIC_PACKAGE_VERSION_FILE will also use it automatically.

@Optiligence
Copy link

everything ${CMAKE_INSTALL_PREFIX}/lib/cmake should be lib/cmake/Snappy, it currently installs to <build_dir>/<install_prefix>/<install_prefix>/lib/Snappy/cmake if a relative CMAKE_INSTALL_PREFIX is used

Optiligence pushed a commit to Optiligence/snappy that referenced this pull request Mar 22, 2017
@Optiligence
Copy link

also, the export set is currently kinda useless because it doesn’t export any targets (and this is basically what #16 (comment) was intended to be about)

i’d also vote for using lower case for the CMake code

I added proposed changes here https://github.com/Optiligence/snappy/tree/cmake
I’m not sure how to proceed with this though.

@vrabaud vrabaud force-pushed the cmake branch 5 times, most recently from ae6f3d6 to 5188792 Compare March 23, 2017 13:08
@vrabaud
Copy link
Contributor Author

vrabaud commented Mar 23, 2017

@Optiligence , I believe I took your comments into account in a new commit (except fro capitalization for now). I also added some older fixes that I had squashed in the older CMakeLists.txt commit (shouldn't have sorry).

@Optiligence
Copy link

Optiligence commented Mar 23, 2017

Several parts are different (missing, wrong), you can squash the commits from here https://github.com/Optiligence/snappy/tree/cmake_upper_case instead
although i’d really do the capitalization now too as a baseline instead of sometime later.
(I can also change the capitalization of my changes to upper case, although that defeats my intention of having it all lower case in the end.)
I also added a line on my previous HEAD commit and added another commit regarding static and shared flavors.

@Optiligence
Copy link

I was also thinking that the output name should contain the ABI version, as it currently does with autotools.

@vrabaud vrabaud force-pushed the cmake branch 3 times, most recently from 523dc27 to cf1aad0 Compare March 24, 2017 08:55
@vrabaud vrabaud force-pushed the cmake branch 2 times, most recently from 8145ab6 to 9b8e53a Compare March 24, 2017 10:58
CMakeLists.txt Outdated
CHECK_INCLUDE_FILES("string.h" HAVE_STRING_H)
CHECK_INCLUDE_FILES("sys/byteswap.h" HAVE_SYS_BYTESWAP_H)
CHECK_INCLUDE_FILES("sys/endian.h" HAVE_SYS_ENDIAN_H)
CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H)

Choose a reason for hiding this comment

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

Duplicate from line 24

We need CMake 3.4 which is not in 14.04 hence the jump to 16.04.
@wesm
Copy link

wesm commented Apr 18, 2017

Any updates here / anything others can do to help? We would love to put up a Snappy windows build on https://github.com/conda-forge/snappy-feedstock

@alkis
Copy link
Contributor

alkis commented Apr 22, 2017 via email

@KindDragon
Copy link

@alkis
Copy link
Contributor

alkis commented Jun 2, 2017

I am closing this PR since we have submitted CMake internally and it will be part of the next release.

@alkis alkis closed this Jun 2, 2017
pwnall pushed a commit to pwnall/snappy that referenced this pull request Jun 5, 2017
@Optiligence Optiligence mentioned this pull request Jul 20, 2017
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.

7 participants