Skip to content

Commit

Permalink
Build: Include uring regardless of the kernel.
Browse files Browse the repository at this point in the history
  • Loading branch information
ishkhan42 committed Mar 29, 2023
1 parent 323188f commit 13eb530
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()

# Check if we are running on Linux
if(UNIX AND NOT APPLE)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LINUX TRUE)
endif()

Expand Down
18 changes: 1 addition & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@
long_description = f.read()


def system_has_uring():
if platform.system() != 'Linux':
return False

kernel_version = platform.release()
major, minor = (int(i) for i in kernel_version.split('.')[:2])

if major < 5:
return False
if major > 5:
return True
if minor < 19:
return False
return True


class CMakeExtension(Extension):
def __init__(self, name, source_dir=''):
Extension.__init__(self, name, sources=[])
Expand All @@ -41,7 +25,7 @@ def __init__(self, name, source_dir=''):

class CMakeBuild(build_ext):
def build_extension(self, ext):
if 'uring' in ext.name and not system_has_uring():
if 'uring' in ext.name and platform.system() != 'Linux':
return

self.parallel = multiprocessing.cpu_count() // 2
Expand Down

0 comments on commit 13eb530

Please sign in to comment.