From 6baed88724df3ea6e31b9ff23510d3b256b97fa0 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 28 Dec 2014 07:11:55 +0000 Subject: Check if threading library needs to be linked separately diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index a407271..ab67056 100755 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -85,7 +85,8 @@ else() endif() if(UNIX) - list(APPEND PLATFORM_LIBS pthread) + find_package(Threads) + list(APPEND PLATFORM_LIBS ${CMAKE_THREAD_LIBS_INIT}) find_library(LIBRT rt) if(LIBRT) list(APPEND PLATFORM_LIBS rt) -- 2.50.1 From fc9237a853febebe9a91de41bfd910f79ed7d7c5 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 28 Dec 2014 07:13:56 +0000 Subject: Add an option to adjust headers installation path diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index ab67056..790829d 100755 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -373,6 +373,7 @@ endif() # Build options set(LIB_INSTALL_DIR lib CACHE STRING "Install location of libraries") set(BIN_INSTALL_DIR bin CACHE STRING "Install location of executables") +set(INCLUDE_INSTALL_DIR include CACHE STRING "Install location of headers") set(EXTRA_LIB "" CACHE STRING "Extra libraries to link against") set(EXTRA_LINK_FLAGS "" CACHE STRING "Extra link flags") if(EXTRA_LINK_FLAGS) -- 2.50.1 From 628228d8c2f8ec3129e170c821599905139d594f Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 28 Dec 2014 07:14:34 +0000 Subject: Add Haiku version of adjusting thread priority diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 790829d..c4ca46e 100755 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -600,7 +600,8 @@ if(SVTHEVC_FOUND) install(FILES "${SVT_HEVC_LIBRARY}" DESTINATION ${LIB_INSTALL_DIR}) endif() -install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include) +install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" + DESTINATION "${INCLUDE_INSTALL_DIR}") if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED)) if(MSVC_IDE) install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) -- 2.50.1 From 573fe3a9b9551744149dd55f57ac0929905823a5 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Fri, 25 Oct 2019 21:18:33 +0200 Subject: avoid using nice. diff --git a/source/common/threadpool.cpp b/source/common/threadpool.cpp index 2db7a14..0df90c8 100644 --- a/source/common/threadpool.cpp +++ b/source/common/threadpool.cpp @@ -118,7 +118,9 @@ void WorkerThread::threadMain() #if _WIN32 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL); #else +#ifndef __HAIKU__ __attribute__((unused)) int val = nice(10); +#endif #endif m_pool.setCurrentThreadAffinity(); -- 2.50.1 From 29df0ee3347a056620107018349832905f65111c Mon Sep 17 00:00:00 2001 From: Elio Blanca Date: Mon, 28 Feb 2022 23:29:47 +0000 Subject: fix detection of cpu cores diff --git a/source/common/threadpool.cpp b/source/common/threadpool.cpp index 0df90c8..52b3435 100644 --- a/source/common/threadpool.cpp +++ b/source/common/threadpool.cpp @@ -636,7 +636,7 @@ int ThreadPool::getCpuCount() /* Return the number of processors configured by OS. Because, most embedded linux distributions * uses only one processor as the scheduler doesn't have enough work to utilize all processors */ return sysconf(_SC_NPROCESSORS_CONF); -#elif __unix__ +#elif defined(__unix__) || defined(__HAIKU__) return sysconf(_SC_NPROCESSORS_ONLN); #elif MACOS && __MACH__ int nm[2]; -- 2.50.1 From d7d46409057b52fd5f61f8ed11a67675a6abcadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= Date: Tue, 15 Mar 2022 21:59:51 +0100 Subject: Add Haiku to the known OS list diff --git a/source/common/version.cpp b/source/common/version.cpp index 42a6b1d..9a626f4 100644 --- a/source/common/version.cpp +++ b/source/common/version.cpp @@ -67,6 +67,8 @@ #define ONOS "[Cygwin]" #elif __APPLE__ #define ONOS "[Mac OS X]" +#elif __HAIKU__ +#define ONOS "[HAIKU]" #else #define ONOS "[Unk-OS]" #endif -- 2.50.1 From 38d40114b91787002813715a397e4967eda3e6ea Mon Sep 17 00:00:00 2001 From: Luc Schrijvers Date: Fri, 29 Aug 2025 10:48:51 +0200 Subject: Fix building with cmake > 4 diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt old mode 100755 new mode 100644 index c4ca46e..832296c --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -7,13 +7,13 @@ if(NOT CMAKE_BUILD_TYPE) endif() message(STATUS "cmake version ${CMAKE_VERSION}") if(POLICY CMP0025) - cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang + cmake_policy(SET CMP0025 NEW) # report Apple's Clang as just Clang endif() if(POLICY CMP0042) cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH endif() if(POLICY CMP0054) - cmake_policy(SET CMP0054 OLD) # Only interpret if() arguments as variables or keywords when unquoted + cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted endif() project (x265) -- 2.50.1