summarylogtreecommitdiffstats
path: root/mingw.patch
blob: eb666e0c3ec8be62ab09287503c669a94d04b5a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 <pthread.h>
+
 #if _MSC_VER
 #pragma warning(disable: 4996) // POSIX functions are just fine, thanks
 #pragma warning(disable: 4706) // assignment within conditional