Remove cmake build system and submodules

setup.py works fine, and we don't need two separate build systems.

Remove the submodules as well because we aren't using them and don't
need them; you should install pybind11 and oxenmq outside this project.
This commit is contained in:
Jason Rhinelander 2021-10-22 16:09:36 -03:00
parent a62f6c4769
commit 6a382865b2
6 changed files with 1 additions and 64 deletions

8
.gitmodules vendored
View File

@ -1,8 +0,0 @@
[submodule "external/pybind11"]
path = external/pybind11
url = https://github.com/pybind/pybind11
branch = stable
[submodule "external/oxen-mq"]
path = external/oxen-mq
url = https://github.com/oxen-io/oxen-mq
branch = dev

View File

@ -1,52 +0,0 @@
cmake_minimum_required(VERSION 3.10) # bionic's cmake version
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()
project(pyoxenmq
VERSION 1.0.0
DESCRIPTION "python interface to OxenMQ"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(SUBMODULE_CHECK "Enables checking that vendored library submodules are up to date" ON)
if(SUBMODULE_CHECK)
find_package(Git)
if(GIT_FOUND)
function(check_submodule relative_path)
execute_process(COMMAND git rev-parse "HEAD" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${relative_path} OUTPUT_VARIABLE localHead)
execute_process(COMMAND git rev-parse "HEAD:${relative_path}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE checkedHead)
string(COMPARE EQUAL "${localHead}" "${checkedHead}" upToDate)
if (upToDate)
message(STATUS "Submodule '${relative_path}' is up-to-date")
else()
message(FATAL_ERROR "Submodule '${relative_path}' is not up-to-date. Please update with\ngit submodule update --init --recursive\nor run cmake with -DSUBMODULE_CHECK=OFF")
endif()
endfunction ()
check_submodule(external/pybind11)
check_submodule(external/oxen-mq)
endif()
endif()
add_subdirectory(external/pybind11)
pybind11_add_module(oxenmq MODULE
src/bencode.cpp
src/oxenmq.cpp
src/module.cpp
)
if(TARGET oxenmq::oxenmq)
target_link_libraries(pyoxenmq PRIVATE oxenmq::oxenmq)
else()
include(FindPkgConfig)
pkg_check_modules(oxenmq REQUIRED IMPORTED_TARGET liboxenmq>=1.2.8)
target_link_libraries(oxenmq PRIVATE PkgConfig::oxenmq)
endif()

1
external/oxen-mq vendored

@ -1 +0,0 @@
Subproject commit dccbd1e8cdb9f57206077facdf973c8e86fc6bec

1
external/pybind11 vendored

@ -1 +0,0 @@
Subproject commit 97976c16fb7652f7faf02d76756666ef87adbe7d

View File

@ -2,7 +2,7 @@
requires = [
"setuptools>=42",
"wheel",
"pybind11>=2.4.0",
"pybind11>=2.6.0",
]
build-backend = "setuptools.build_meta"

View File

@ -26,6 +26,5 @@ setup(
description="Python wrapper for oxen-mq message passing library",
long_description="",
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
zip_safe=False,
)