Skip to content

Commit

Permalink
Use cmake to build rsa library
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainL972 committed Jan 26, 2020
1 parent 821d714 commit cb8a663
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
14 changes: 14 additions & 0 deletions rsa/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.16)

project(RSA VERSION 1.0.0)

set (CMAKE_CXX_FLAGS "-lgmp -lgmpxx -I/usr/include/python3.8")

add_library(rsa SHARED
src/rsa.cpp
src/rsamodule.cpp
)

set_target_properties(rsa PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(rsa PROPERTIES SOVERSION 1)
target_include_directories(rsa PRIVATE include)
File renamed without changes.
11 changes: 0 additions & 11 deletions rsa/setup.py

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions rsa/rsamodule.cpp → rsa/src/rsamodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ static PyMethodDef RSAMethods[] = {

static struct PyModuleDef rsamodule = {
PyModuleDef_HEAD_INIT,
"rsa", /* name of module */
"librsa", /* name of module */
NULL, /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module,
or -1 if the module keeps state in global variables. */
RSAMethods
};

PyMODINIT_FUNC
PyInit_rsa(void)
PyInit_librsa(void)
{
return PyModule_Create(&rsamodule);
}

0 comments on commit cb8a663

Please sign in to comment.