aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/reicast/files/patch-CMakeLists.txt
blob: ce7313b51ea785512b7e9133f35c8e07da75f70c (plain) (blame)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
--- CMakeLists.txt.orig	2020-10-18 11:22:48 UTC
+++ CMakeLists.txt
@@ -100,20 +100,29 @@ set(core_SRCS
   ${d_core}/serialize.cpp
 )
 
-if(${BUILD_COMPILER} EQUAL ${COMPILER_GCC} OR (${BUILD_COMPILER} EQUAL ${COMPILER_CLANG} AND ${HOST_OS} EQUAL ${OS_DARWIN})) # TODO: Test with Clang on other platforms
+if(${BUILD_COMPILER} EQUAL ${COMPILER_GCC} OR (${BUILD_COMPILER} EQUAL ${COMPILER_CLANG} AND (${HOST_OS} EQUAL ${OS_DARWIN} OR ${HOST_OS} EQUAL ${OS_FREEBSD})))
   list(APPEND core_SRCS ${archive_SRCS})
 endif()
 
 if(${FEAT_SHREC} EQUAL ${DYNAREC_JIT}) 
 
   if(${HOST_CPU} EQUAL ${CPU_X86})
-    list(APPEND core_SRCS 
-      ${d_core}/jit/backend/x86/rec_x86_driver.cpp
-      ${d_core}/jit/backend/x86/rec_x86_asm.cpp	# change for linux , rec_lin86_asm.S
-	  ${d_core}/jit/backend/x86/rec_x86_ngen.h
-
-      ${d_core}/jit/emitter/x86/x86_emitter.cpp
-     )
+    if (${HOST_OS} EQUAL ${OS_LINUX} OR (${HOST_OS} EQUAL ${OS_FREEBSD}))
+      list(APPEND core_SRCS 
+        ${d_core}/jit/backend/x86/rec_x86_driver.cpp
+        ${d_core}/jit/backend/x86/rec_lin86_asm.S
+        ${d_core}/jit/backend/x86/rec_x86_asm.cpp
+        ${d_core}/jit/backend/x86/rec_x86_ngen.h
+        ${d_core}/jit/emitter/x86/x86_emitter.cpp
+      )
+    else()
+      list(APPEND core_SRCS 
+        ${d_core}/jit/backend/x86/rec_x86_driver.cpp
+        ${d_core}/jit/backend/x86/rec_x86_asm.cpp
+        ${d_core}/jit/backend/x86/rec_x86_ngen.h
+        ${d_core}/jit/emitter/x86/x86_emitter.cpp
+      )
+    endif()
   elseif(${HOST_CPU} EQUAL ${CPU_ARM})
     list(APPEND core_SRCS 
       ${d_core}/rec-ARM/ngen_arm.S
@@ -139,6 +148,8 @@ add_definitions(/DFEAT_HAS_SOFTREND=1)
 
 if(${HOST_OS} EQUAL ${OS_LINUX})
   add_definitions(-DLUA_USE_LINUX)
+elseif(${HOST_OS} EQUAL ${OS_FREEBSD})
+  add_definitions(-DLUA_USE_FREEBSD)
 endif()
 
 ### deps.cmake #################################################################################
@@ -149,6 +160,7 @@ set(gpl_deps ${reicast_core_path}/gpl/deps)
 include_directories ("${d_deps}")
 include_directories ("${gpl_deps}/picotcp/include")
 include_directories ("${gpl_deps}/picotcp/modules")
+include_directories ("${d_deps}/intrin")
 
 file(GLOB xbyak_H	${d_deps}/xbyak/*.h)		# include headers into cmake target/project view 
 
@@ -185,8 +197,8 @@ set(deps_SRCS
   ${d_deps}/coreio/coreio.cpp
   ${xbyak_H}
 )
-  
-if(${BUILD_COMPILER} EQUAL ${COMPILER_GCC} OR (${BUILD_COMPILER} EQUAL ${COMPILER_CLANG} AND ${HOST_OS} EQUAL ${OS_DARWIN})) # TODO: Test with Clang on other platforms
+
+if(${BUILD_COMPILER} EQUAL ${COMPILER_GCC} OR (${BUILD_COMPILER} EQUAL ${COMPILER_CLANG} AND (${HOST_OS} EQUAL ${OS_DARWIN} OR ${HOST_OS} EQUAL ${OS_FREEBSD})))
   list(APPEND deps_SRCS
     ${lzip_SRCS}
     ${lzma_SRCS}
@@ -228,7 +240,7 @@ if (${HOST_OS} EQUAL ${OS_WINDOWS})
   list(APPEND osd_SRCS ${d_core}/oslib/windows/threading.cpp)
   list(APPEND osd_SRCS ${d_aout}/audiobackend_directsound.cpp)
   link_libraries(dsound.lib winmm.lib xinput.lib wsock32.lib opengl32.lib)
-elseif (${HOST_OS} EQUAL ${OS_LINUX} OR ${HOST_OS} EQUAL ${OS_ANDROID})
+elseif (${HOST_OS} EQUAL ${OS_LINUX} OR ${HOST_OS} EQUAL ${OS_ANDROID} OR ${OS_FREEBSD})
 
     list(APPEND osd_SRCS
       ${d_core}/linux-dist/main.cpp
@@ -294,7 +306,7 @@ endif()
 
 target_compile_features(${TNAME}${binSuffix} PRIVATE cxx_std_14)
 
-if(${HOST_OS} EQUAL ${OS_LINUX})
+if(${HOST_OS} EQUAL ${OS_LINUX} OR ${HOST_OS} EQUAL ${OS_FREEBSD})
   # needed for opentty
   target_link_libraries(${TNAME} -lutil)
 
@@ -431,6 +443,8 @@ if(${HOST_OS} EQUAL ${OS_DARWIN})
 
 endif()
 
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
 
 if(DEBUG_CMAKE)
   message(" ------------------------------------------------")