Skip to content

Commit

Permalink
Test reverse condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ManickaP committed Apr 26, 2024
1 parent e1f74cd commit 4dcaa92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,16 @@ elseif (APPLE)
set(CX_PLATFORM "darwin")
elseif (UNIX)
set(CX_PLATFORM "linux")
file(STRINGS "/etc/os-release" OS_RELEASE_CONTENT)
string(REGEX MATCH "VERSION_ID=\"?([0-9]+\\.[0-9]+)\"?" _ ${OS_RELEASE_CONTENT})
set(UBUNTU_VERSION ${CMAKE_MATCH_1})
file(STRINGS "/etc/os-release" OS_RELEASE_CONTENT NEWLINE_CONSUME)
message(STATUS "${OS_RELEASE_CONTENT}")
string(REGEX MATCH "NAME=\"?([A-Za-z0-9_]+)\"?" _ ${OS_RELEASE_CONTENT})
string(TOLOWER "${CMAKE_MATCH_1}" LINUX_DISTRIBUTION)
message(STATUS "${LINUX_DISTRIBUTION}")
if (LINUX_DISTRIBUTION STREQUAL "ubuntu")
string(REGEX MATCH "VERSION_ID=\"?([0-9]+\\.[0-9]+)\"?" _ ${OS_RELEASE_CONTENT})
set(UBUNTU_VERSION ${CMAKE_MATCH_1})
endif()
message(STATUS "${UBUNTU_VERSION}")
endif()
message(STATUS "QUIC Platform: ${CX_PLATFORM}")

Expand Down
11 changes: 3 additions & 8 deletions src/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,11 @@ else()
set(SOURCES ${SOURCES} inline.c platform_posix.c storage_posix.c cgroup.c datapath_unix.c)
if(CX_PLATFORM STREQUAL "linux" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(SOURCES ${SOURCES} datapath_linux.c datapath_epoll.c)
if ((${UBUNTU_VERSION} STREQUAL "20.04") OR
(${CMAKE_TARGET_ARCHITECTURE} STREQUAL "arm64") OR
(${CMAKE_TARGET_ARCHITECTURE} STREQUAL "arm") OR
(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm") OR
(ANDROID) OR
(QUIC_CARGO_BUILD))
set(SOURCES ${SOURCES} datapath_xplat.c datapath_raw_dummy.c)
else()
if ("${UBUNTU_VERSION}" STREQUAL "22.04")
set(LINUX_XDP_ENABLED TRUE)
set(SOURCES ${SOURCES} datapath_xplat.c datapath_raw.c datapath_raw_linux.c datapath_raw_socket.c datapath_raw_socket_linux.c datapath_raw_xdp_linux.c)
else()
set(SOURCES ${SOURCES} datapath_xplat.c datapath_raw_dummy.c)
endif()
else()
set(SOURCES ${SOURCES} datapath_kqueue.c)
Expand Down

0 comments on commit 4dcaa92

Please sign in to comment.