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

fido2: build shared libraries #1141

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From dd8f6403dd58e67b3f62fa7d41f8d16ac3cdfd40 Mon Sep 17 00:00:00 2001
From: Ignacio Casal Quinteiro <[email protected]>
Date: Wed, 15 Nov 2023 11:39:36 +0100
Subject: [PATCH] Install pkgconfig files also on msvc

---
src/CMakeLists.txt | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 73493b1..4c54198 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -151,8 +151,6 @@ endif()
install(FILES fido.h DESTINATION include)
install(DIRECTORY fido DESTINATION include)

-if(NOT MSVC)
- configure_file(libfido2.pc.in libfido2.pc @ONLY)
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libfido2.pc"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
-endif()
+configure_file(libfido2.pc.in libfido2.pc @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libfido2.pc"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
--
2.34.1

9 changes: 6 additions & 3 deletions gvsbuild/projects/libfido2.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def __init__(self):
"openssl",
"libcbor",
],
patches=["0001-libfido2-update-cmake-script-to-have-sdl-flag-before.patch"],
patches=[
"0001-libfido2-update-cmake-script-to-have-sdl-flag-before.patch",
"0001-Install-pkgconfig-files-also-on-msvc.patch",
],
)

def build(self):
Expand All @@ -48,8 +51,8 @@ def build(self):
include_dirs = os.path.join(self.builder.gtk_dir, "inc")
lib_dirs = os.path.join(self.builder.gtk_dir, "lib")
bin_dirs = lib_dirs = os.path.join(self.builder.gtk_dir, "bin")
# Build static libs only for libfido2
build_params = '-DBUILD_EXAMPLES=OFF -DBUILD_MANPAGES=OFF -DBUILD_TESTS=OFF -DBUILD_TOOLS=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS_DEBUG="/MTd /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE" -DCMAKE_C_FLAGS_RELEASE="/MT /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE"'

build_params = "-DBUILD_EXAMPLES=OFF -DBUILD_MANPAGES=OFF -DBUILD_TESTS=OFF -DBUILD_TOOLS=OFF -DBUILD_STATIC_LIBS=OFF"
cmake_params = f"-DWITH_ZLIB=ON -DCBOR_INCLUDE_DIRS={include_dirs} -DCRYPTO_INCLUDE_DIRS={include_dirs} -DZLIB_INCLUDE_DIRS={include_dirs} -DCBOR_LIBRARY_DIRS={lib_dirs} -DCRYPTO_LIBRARY_DIRS={lib_dirs} -DZLIB_LIBRARY_DIRS={lib_dirs} -DCBOR_BIN_DIRS={bin_dirs} -DCRYPTO_BIN_DIRS={bin_dirs} -DZLIB_BIN_DIRS={bin_dirs} {build_params}"

CmakeProject.build(self, cmake_params=cmake_params, use_ninja=True)
Expand Down