Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
GhazanfarShahbaz committed Jun 20, 2024
1 parent 6b14075 commit b5dfe7a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 40 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ set(CMAKE_CXX_STANDARD 17)
add_subdirectory(./lib/include/pybind11)
add_subdirectory(./lib/src)

set(SOURCE_DIR "token_granter_wrapper")
set(SOURCE_DIR "src/token_granter_wrapper")
set(SOURCES "${SOURCE_DIR}/token_granter_bindings.cpp")

pybind11_add_module(token_granter_bindings ${SOURCES})
# set_target_properties(token_granter_bindings PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(token_granter_bindings PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/token_granter_wrapper)
target_link_libraries(token_granter_bindings PRIVATE token_granter)
21 changes: 7 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
Modified from https://www.benjack.io/2017/06/12/python-cpp-tests.html
'''
class CMakeExtension(Extension):
def __init__(self, name, sourcedir='', sources=[]):
Extension.__init__(self, name, sources=sources)
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
self.sourcedir = os.path.abspath(sourcedir)


Expand Down Expand Up @@ -56,10 +56,6 @@ def build_extension(self, ext):
build_args += ['--', '/m']
else:
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]

if(platform.system() == "Darwin"):
cmake_args.append('-DCMAKE_CXX_FLAGS=-march=armv8-a')

build_args += ['--', '-j2']

env = os.environ.copy()
Expand All @@ -76,19 +72,16 @@ def build_extension(self, ext):

setup(
name="token-granter-wrapper",
version="0.1.0",
description="Some testing stuff",
packages=setuptools.find_packages("token_granter_wrapper"),
package_dir={"": "token_granter_wrapper"},
version="2.0.0",
packages=setuptools.find_packages("src"),
package_dir={"": "src"},
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: POSIX :: Linux"
],
ext_modules=[CMakeExtension('token_granter_bindings', sources=['token_granter_wrapper/token_granter_bindings.cpp'])],
ext_modules=[CMakeExtension('token_granter_wrapper/token_granter_bindings')],
python_requires='>=3.6',
cmdclass=dict(build_ext=CMakeBuild),
zip_safe=False,
install_requires=[]
)

# https://python.plainenglish.io/building-hybrid-python-c-packages-8985fa1c5b1d
)
1 change: 0 additions & 1 deletion token_granter_wrapper/__init__.py

This file was deleted.

Binary file not shown.
6 changes: 0 additions & 6 deletions token_granter_wrapper/token_granter.pyi

This file was deleted.

16 changes: 0 additions & 16 deletions token_granter_wrapper/token_granter_bindings.cpp

This file was deleted.

0 comments on commit b5dfe7a

Please sign in to comment.