diff -ruN x265_2.5/source/CMakeLists.txt patched/source/CMakeLists.txt --- x265_2.5/source/CMakeLists.txt 2017-07-13 13:20:07.000000000 +0200 +++ patched/source/CMakeLists.txt 2017-08-17 17:04:43.903541062 +0200 @@ -607,7 +607,8 @@ if(ENABLE_HDR10_PLUS) install(TARGETS hdr10plus-shared LIBRARY DESTINATION ${LIB_INSTALL_DIR} - ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + RUNTIME DESTINATION ${BIN_INSTALL_DIR}) endif() if(LINKER_OPTIONS) # set_target_properties can't do list expansion diff -ruN x265_2.5/source/common/CMakeLists.txt patched/source/common/CMakeLists.txt --- x265_2.5/source/common/CMakeLists.txt 2017-07-13 13:20:07.000000000 +0200 +++ patched/source/common/CMakeLists.txt 2017-08-17 17:02:32.291048935 +0200 @@ -116,10 +116,16 @@ string(REPLACE ";" " " VERSION_FLAGS "${VFLAGS}") set_source_files_properties(version.cpp PROPERTIES COMPILE_FLAGS ${VERSION_FLAGS}) -check_symbol_exists(strtok_r "string.h" HAVE_STRTOK_R) -if(HAVE_STRTOK_R) - set_source_files_properties(param.cpp PROPERTIES COMPILE_FLAGS -DHAVE_STRTOK_R=1) -endif() +if(MINGW) + set_source_files_properties(param.cpp PROPERTIES COMPILE_FLAGS -DHAVE_STRTOK_R="1") +else(MINGW) + #FIXME Mingw-w64 defines strtok_r in pthread.h (this needs to be fixed in Mingw-w64) + #check_symbol_exists(strtok_r "string.h" HAVE_STRTOK_R) + check_symbol_exists(strtok_r "pthread.h" HAVE_STRTOK_R) + if(HAVE_STRTOK_R) + set_source_files_properties(param.cpp PROPERTIES COMPILE_FLAGS -DHAVE_STRTOK_R=1) + endif() +endif(MINGW) if(GCC AND CC_HAS_NO_NARROWING) set_source_files_properties(cpu.cpp PROPERTIES COMPILE_FLAGS -Wno-narrowing) diff -ruN x265_2.5/source/common/param.cpp patched/source/common/param.cpp --- x265_2.5/source/common/param.cpp 2017-07-13 13:20:07.000000000 +0200 +++ patched/source/common/param.cpp 2017-08-17 17:02:32.291048935 +0200 @@ -29,6 +29,9 @@ #include "cpu.h" #include "x265.h" +//FIXME For strtok_r in Mingw-w64 (see CMakeLists.txt) +#include + #if _MSC_VER #pragma warning(disable: 4996) // POSIX functions are just fine, thanks #pragma warning(disable: 4706) // assignment within conditional