Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlotte Koch <dressupgeekout@gmail.com>2024-10-24 15:42:26 -0700
committerCharlotte Koch <dressupgeekout@gmail.com>2024-10-24 15:42:26 -0700
commit20c79e32f8aed496f5c9dad433cacdca18aed4cf (patch)
tree5586c9181440ec160acf08b8668a38833f407bfa
parent15d116b7eac53f1d0526aa80ab9d59b89661b128 (diff)
Add preliminary support for NetBSD
-rw-r--r--source/CMakeLists.txt8
-rw-r--r--source/core/StarThread_unix.cpp2
2 files changed, 10 insertions, 0 deletions
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index d13d59d..59fa0a6 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -80,6 +80,8 @@ if(NOT DEFINED STAR_SYSTEM)
set(STAR_SYSTEM "linux")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
set(STAR_SYSTEM "freebsd")
+ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD")
+ set(STAR_SYSTEM "netbsd")
elseif(UNIX)
set(STAR_SYSTEM "unix")
else()
@@ -208,6 +210,8 @@ elseif(STAR_SYSTEM STREQUAL "linux")
set_flag(STAR_SYSTEM_LINUX)
elseif(STAR_SYSTEM STREQUAL "freebsd")
set_flag(STAR_SYSTEM_FREEBSD)
+elseif(STAR_SYSTEM STREQUAL "netbsd")
+ set_flag(STAR_SYSTEM_NETBSD)
endif()
if(STAR_SYSTEM_FAMILY STREQUAL "windows")
@@ -445,6 +449,10 @@ elseif(STAR_SYSTEM_FREEBSD)
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lpthread -lrt")
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lpthread -lrt")
+elseif(STAR_SYSTEM_NETBSD)
+ set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lpthread -lrt -lexecinfo")
+ set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lpthread -lrt -lexecinfo")
+
endif()
# Find all required external libraries, based on build settings...
diff --git a/source/core/StarThread_unix.cpp b/source/core/StarThread_unix.cpp
index 7385ae2..fe82ea3 100644
--- a/source/core/StarThread_unix.cpp
+++ b/source/core/StarThread_unix.cpp
@@ -78,6 +78,8 @@ struct ThreadImpl {
#ifdef STAR_SYSTEM_FREEBSD
pthread_set_name_np(pthread, tname);
+#elif defined(STAR_SYSTEM_NETBSD)
+ pthread_setname_np(pthread, "%s", tname);
#elif not defined STAR_SYSTEM_MACOS
pthread_setname_np(pthread, tname);
#endif