Skip to content

Commit 0e81e04

Browse files
committed
Make it work with our CMakeLists.txt
1 parent d630743 commit 0e81e04

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

recipes/ed25519/all/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if(NOT TARGET OpenSSL::SSL)
1313
endif()
1414

1515
add_library(ed25519 STATIC
16-
ed25519.c
16+
${ED25519_DONNA_SRC_DIR}/ed25519.c
1717
)
1818
add_library(ed25519::ed25519 ALIAS ed25519)
1919
target_link_libraries(ed25519 PUBLIC OpenSSL::SSL)
@@ -46,6 +46,6 @@ install(
4646
NAMESPACE ${PROJECT_NAME}::
4747
)
4848
install(
49-
FILES ed25519.h
49+
FILES ${ED25519_DONNA_SRC_DIR}/ed25519.h
5050
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
5151
)

recipes/ed25519/all/conanfile.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
from conan import ConanFile, tools
2-
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
3-
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
1+
import os
2+
3+
from conan import ConanFile
4+
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
5+
from conan.tools.files import (
6+
apply_conandata_patches,
7+
copy,
8+
export_conandata_patches,
9+
)
410
from conan.tools.scm import Git
511

612
required_conan_version = ">=2.0.0"
713

14+
815
class EdDonnaConan(ConanFile):
916
name = "ed25519"
1017
description = "ed25519 is an Elliptic Curve Digital Signature Algorithm."
@@ -25,7 +32,12 @@ def requirements(self):
2532
self.requires("openssl/[>=1.1 <4]")
2633

2734
def export_sources(self):
28-
copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder+"/src")
35+
copy(
36+
self,
37+
"CMakeLists.txt",
38+
src=self.recipe_folder,
39+
dst=self.export_sources_folder,
40+
)
2941
export_conandata_patches(self)
3042

3143
def config_options(self):
@@ -42,14 +54,15 @@ def source(self):
4254

4355
def generate(self):
4456
tc = CMakeToolchain(self)
57+
tc.variables["ED25519_DONNA_SRC_DIR"] = self.source_folder.replace("\\", "/")
4558
tc.generate()
4659
deps = CMakeDeps(self)
4760
deps.generate()
4861

4962
def build(self):
5063
cmake = CMake(self)
5164
cmake.verbose = True
52-
cmake.configure()
65+
cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir))
5366
cmake.build()
5467

5568
def package(self):

0 commit comments

Comments
 (0)