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: configure may fail when building with custom GSSAPI build #3743

Closed
jzakrzewski opened this issue Apr 7, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@jzakrzewski
Copy link
Contributor

commented Apr 7, 2019

Configuring build of curl 7.64.1 with example command line like:
cmake ../curl -DCMAKE_INSTALL_PREFIX=/work/curl-install -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_USE_GSSAPI=ON -DGSS_ROOT_DIR=/work/krb5-1.17-install -DCMAKE_USE_OPENSSL=OFF -DCMAKE_PREFIX_PATH:PATH=/work/krb5-1.17-install -DCURL_CA_PATH=none -G Ninja

Fails when checking for recv. Error log reveals that it tries to link the Kerberos libraries, which is totally unnecessary.

PR will follow.

jzakrzewski added a commit to jzakrzewski/curl that referenced this issue Apr 7, 2019

jzakrzewski added a commit to jzakrzewski/curl that referenced this issue Apr 7, 2019

cmake: avoid linking executable for some tests with cmake 3.6+
With CMAKE_TRY_COMPILE_TARGET_TYPE set to STATIC_LIBRARY, the try_compile()
(which is used by check_c_source_compiles()) will build static library
instead of executable. This avoids linking additional libraries in and thus
speeds up those checks a little.
Would also avoid curl#3743 on itself with cmake 3.6 or above.

@bagder bagder added the cmake label Apr 7, 2019

jzakrzewski added a commit to jzakrzewski/curl that referenced this issue Apr 8, 2019

cmake: avoid linking executable for some tests with cmake 3.6+
With CMAKE_TRY_COMPILE_TARGET_TYPE set to STATIC_LIBRARY, the try_compile()
(which is used by check_c_source_compiles()) will build static library
instead of executable. This avoids linking additional libraries in and thus
speeds up those checks a little.
Would also avoid curl#3743 on itself with cmake 3.6 or above.

Ref: curl#3744

jzakrzewski added a commit to jzakrzewski/curl that referenced this issue Apr 8, 2019

jzakrzewski added a commit to jzakrzewski/curl that referenced this issue Apr 9, 2019

cmake: avoid linking executable for some tests with cmake 3.6+
With CMAKE_TRY_COMPILE_TARGET_TYPE set to STATIC_LIBRARY, the try_compile()
(which is used by check_c_source_compiles()) will build static library
instead of executable. This avoids linking additional libraries in and thus
speeds up those checks a little.

This commit also avoids curl#3743 (GSSAPI build errors) on itself with cmake
3.6 or above. That issue was fixed separately for all versions.

Ref: curl#3744

jzakrzewski added a commit to jzakrzewski/curl that referenced this issue Apr 9, 2019

cmake: clear CMAKE_REQUIRED_LIBRARIES after each use
This fixes GSSAPI builds with the libraries in a non-standard location.
The testing for recv() were failing because it failed to link
the Kerberos libraries, which are not needed for this or subsequent
tests.

fixes curl#3743
closes curl#3744

jzakrzewski added a commit that referenced this issue Apr 10, 2019

cmake: avoid linking executable for some tests with cmake 3.6+
With CMAKE_TRY_COMPILE_TARGET_TYPE set to STATIC_LIBRARY, the try_compile()
(which is used by check_c_source_compiles()) will build static library
instead of executable. This avoids linking additional libraries in and thus
speeds up those checks a little.

This commit also avoids #3743 (GSSAPI build errors) on itself with cmake
3.6 or above. That issue was fixed separately for all versions.

Ref: #3744
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.