mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
102 lines
4.0 KiB
Diff
102 lines
4.0 KiB
Diff
From 9afb43851d64a4ed67b96332e8c5a48afdf9d308 Mon Sep 17 00:00:00 2001
|
|
From: begasus <begasus@gmail.com>
|
|
Date: Sat, 18 Feb 2023 10:21:53 +0100
|
|
Subject: [PATCH 1/2] filesystem.hpp, add support for Haiku
|
|
|
|
---
|
|
include/ghc/filesystem.hpp | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp
|
|
index 1d39b81..3ae48f2 100644
|
|
--- a/include/ghc/filesystem.hpp
|
|
+++ b/include/ghc/filesystem.hpp
|
|
@@ -78,6 +78,8 @@
|
|
#include <wasi/api.h>
|
|
#elif defined(__QNX__)
|
|
#define GHC_OS_QNX
|
|
+#elif defined(__HAIKU__)
|
|
+#define GHC_OS_HAIKU
|
|
#else
|
|
#error "Operating system currently not supported!"
|
|
#endif
|
|
|
|
From a9c18e0880a8289bbbb062d8ba356e9a6ff1cbc5 Mon Sep 17 00:00:00 2001
|
|
From: begasus <begasus@gmail.com>
|
|
Date: Sun, 19 Feb 2023 09:11:34 +0100
|
|
Subject: [PATCH 2/2] Fix Haiku build
|
|
|
|
---
|
|
cmake/GhcHelper.cmake | 9 +++++++++
|
|
test/CMakeLists.txt | 9 +++++++++
|
|
2 files changed, 18 insertions(+)
|
|
|
|
diff --git a/cmake/GhcHelper.cmake b/cmake/GhcHelper.cmake
|
|
index ca0f787..4d9e5a0 100644
|
|
--- a/cmake/GhcHelper.cmake
|
|
+++ b/cmake/GhcHelper.cmake
|
|
@@ -22,6 +22,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND (CMAKE_CXX_COMPILER_VERSION V
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "(SunOS|Solaris)")
|
|
target_link_libraries(filesystem_test xnet)
|
|
endif()
|
|
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
|
+ target_link_libraries(filesystem_test network)
|
|
+ endif()
|
|
target_compile_definitions(${targetName} PRIVATE USE_STD_FS)
|
|
endif()
|
|
|
|
@@ -34,6 +37,9 @@ if (CMAKE_COMPILER_IS_GNUCXX AND (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 8.0 O
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "(SunOS|Solaris)")
|
|
target_link_libraries(${targetName} xnet)
|
|
endif()
|
|
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
|
+ target_link_libraries(${targetName} network)
|
|
+ endif()
|
|
target_compile_options(${targetName} PRIVATE $<$<BOOL:${CYGWIN}>:-Wa,-mbig-obj>)
|
|
target_compile_definitions(${targetName} PRIVATE USE_STD_FS)
|
|
endif()
|
|
@@ -55,6 +61,9 @@ macro(AddTestExecutableWithStdCpp cppStd)
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "(SunOS|Solaris)")
|
|
target_link_libraries(filesystem_test_cpp${cppStd} xnet)
|
|
endif()
|
|
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
|
+ target_link_libraries(filesystem_test_cpp${cppStd} network)
|
|
+ endif()
|
|
target_compile_options(filesystem_test_cpp${cppStd} PRIVATE
|
|
$<$<BOOL:${EMSCRIPTEN}>:-s DISABLE_EXCEPTION_CATCHING=0>
|
|
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Werror -Wno-error=deprecated-declarations>
|
|
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
|
index cf7237e..2275c61 100644
|
|
--- a/test/CMakeLists.txt
|
|
+++ b/test/CMakeLists.txt
|
|
@@ -25,6 +25,9 @@ if(GHC_COVERAGE)
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "(SunOS|Solaris)")
|
|
target_link_libraries(filesystem_test PUBLIC xnet)
|
|
endif()
|
|
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
|
+ target_link_libraries(filesystem_test PUBLIC network)
|
|
+ endif()
|
|
if("cxx_std_17" IN_LIST GHC_FILESYSTEM_TEST_COMPILE_FEATURES)
|
|
AddTestExecutableWithStdCpp(17 filesystem_test.cpp catch.hpp)
|
|
endif()
|
|
@@ -38,6 +41,9 @@ else()
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "(SunOS|Solaris)")
|
|
target_link_libraries(filesystem_test xnet)
|
|
endif()
|
|
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
|
+ target_link_libraries(filesystem_test network)
|
|
+ endif()
|
|
SetTestCompileOptions(filesystem_test)
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
|
target_compile_definitions(filesystem_test PRIVATE _CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN NOMINMAX)
|
|
@@ -77,6 +83,9 @@ target_link_libraries(fwd_impl_test ghc_filesystem)
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "(SunOS|Solaris)")
|
|
target_link_libraries(fwd_impl_test xnet)
|
|
endif()
|
|
+if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
|
+ target_link_libraries(fwd_impl_test network)
|
|
+endif()
|
|
SetTestCompileOptions(fwd_impl_test)
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
|
target_compile_definitions(fwd_impl_test PRIVATE _CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN NOMINMAX)
|