Skip to content

Allow creation of shared library for libTink#1

Open
chaudhryusama wants to merge 1 commit intotink-crypto:mainfrom
chaudhryusama:main
Open

Allow creation of shared library for libTink#1
chaudhryusama wants to merge 1 commit intotink-crypto:mainfrom
chaudhryusama:main

Conversation

@chaudhryusama
Copy link

This commit enable to cross compile the libTink by creating a shared library.

@morambro morambro self-assigned this May 26, 2023
@morambro morambro added the enhancement New feature or request label May 26, 2023
endif()
# Rapidjson is a header-only library with no explicit target. Here we create one.
add_library(rapidjson INTERFACE)
target_include_directories(rapidjson INTERFACE "${rapidjson_SOURCE_DIR}")
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this variable populated when TINK_USE_INSTALLED_RAPIDJSON=ON?

"$<BUILD_INTERFACE:${boringssl_SOURCE_DIR}/src/include>")
else()
# Support for ED25519 was added from 1.1.1.
find_package(OpenSSL 1.1.1 REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Leaving 1.1.1 here provides a lower bound for OpenSSL which is what we want. I my understanding correct?

tink_cc_library(
NAME cc
SRCS
set(TINK_PUBLIC_APIS
Copy link
Contributor

Choose a reason for hiding this comment

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

TINK_PUBLIC_API_HDRS?

${TINK_PUBLIC_APIS}
DEPS
${TINK_PUBLIC_API_DEPS}
PUBLIC
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: PUBLIC should be aligned with DEPS

target_link_libraries(tink
PRIVATE
-Wl,--whole-archive
${TINK_PUBLIC_API_DEPS}
Copy link
Contributor

Choose a reason for hiding this comment

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

If we do this, would the tink target include (and export) absl?

This commit enable to cross compile the libTink
by creating a shared library.

Signed-off-by: Muhammad Usama <[email protected]>
@sysdev-jay
Copy link

sysdev-jay commented Mar 25, 2024

@chaudhryusama @morambro
I have tried this building creation of shared library for libtink.
I am getting following error in step
cmake --build .

I have cloned this: https://github.com/chaudhryusama/tink-cc

My Cmake command:
$ cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DTINK_BUILD_SHARED_LIB=ON
$ cmake --build .

[ 83%] Linking CXX shared library libtink.dylib
**clang: error: invalid linker name in argument '-fuse-ld=gold'**
make[2]: *** [tink/libtink.2.1.1.dylib] Error 1
make[1]: *** [tink/CMakeFiles/tink.dir/all] Error 2
make: *** [all] Error 2
(base) itadmin@ITs-MacBook-Pro build %

Platform: macOS 14.2 MacBook Pro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants