From a9c18e0880a8289bbbb062d8ba356e9a6ff1cbc5 Mon Sep 17 00:00:00 2001 From: begasus Date: Sun, 19 Feb 2023 09:11:34 +0100 Subject: [PATCH] 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 $<$:-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 $<$:-s DISABLE_EXCEPTION_CATCHING=0> $<$,$>:-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)