Backported #6865: Disable websockets command line option
[platform/upstream/freerdp.git] / cmake / ConfigOptions.cmake
1 include(CMakeDependentOption)
2
3 if((CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686|x86|AMD64") AND (CMAKE_SIZEOF_VOID_P EQUAL 4))
4         set(TARGET_ARCH "x86")
5 elseif((CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64") AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
6         set(TARGET_ARCH "x64")
7 elseif((CMAKE_SYSTEM_PROCESSOR MATCHES "i386") AND (CMAKE_SIZEOF_VOID_P EQUAL 8) AND (APPLE))
8         # Mac is weird like that.
9         set(TARGET_ARCH "x64")
10 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm*")
11         set(TARGET_ARCH "ARM")
12 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
13         set(TARGET_ARCH "sparc")
14 endif()
15
16 option(WITH_MANPAGES "Generate manpages." ON)
17 option(WITH_PROFILER "Compile profiler." OFF)
18 option(WITH_GPROF "Compile with GProf profiler." OFF)
19
20 if((TARGET_ARCH MATCHES "x86|x64") AND (NOT DEFINED WITH_SSE2))
21         option(WITH_SSE2 "Enable SSE2 optimization." ON)
22 else()
23         option(WITH_SSE2 "Enable SSE2 optimization." OFF)
24 endif()
25
26 if(TARGET_ARCH MATCHES "ARM")
27         if (NOT DEFINED WITH_NEON)
28                 option(WITH_NEON "Enable NEON optimization." ON)
29         else()
30                 option(WITH_NEON "Enable NEON optimization." OFF)
31         endif()
32 else()
33         if(NOT APPLE)
34                 option(WITH_IPP "Use Intel Performance Primitives." OFF)
35         endif()
36 endif()
37
38 option(WITH_JPEG "Use JPEG decoding." OFF)
39
40 if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
41         set(CMAKE_COMPILER_IS_CLANG 1)
42 endif()
43
44 if(NOT WIN32)
45         CMAKE_DEPENDENT_OPTION(WITH_VALGRIND_MEMCHECK "Compile with valgrind helpers." OFF
46                 "NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_MEMORY; NOT WITH_SANITIZE_THREAD" OFF)
47         CMAKE_DEPENDENT_OPTION(WITH_SANITIZE_ADDRESS "Compile with gcc/clang address sanitizer." OFF
48                 "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_MEMORY; NOT WITH_SANITIZE_THREAD" OFF)
49         CMAKE_DEPENDENT_OPTION(WITH_SANITIZE_MEMORY "Compile with gcc/clang memory sanitizer." OFF
50         "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_THREAD" OFF)
51         CMAKE_DEPENDENT_OPTION(WITH_SANITIZE_THREAD "Compile with gcc/clang thread sanitizer." OFF
52                 "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_MEMORY" OFF)
53 else()
54         if(NOT UWP)
55                 option(WITH_MEDIA_FOUNDATION "Enable H264 media foundation decoder." ON)
56         endif()
57 endif()
58
59 if(WIN32 AND NOT UWP)
60         option(WITH_NATIVE_SSPI "Use native SSPI modules" ON)
61         option(WITH_WINMM "Use Windows Multimedia" ON)
62         option(WITH_WIN8 "Use Windows 8 libraries" OFF)
63 endif()
64
65 option(WITH_SMARTCARD_INSPECT "Enable SmartCard API Inspector" OFF)
66
67 option(BUILD_TESTING "Build unit tests" OFF)
68 CMAKE_DEPENDENT_OPTION(TESTS_WTSAPI_EXTRA "Build extra WTSAPI tests (interactive)" OFF "BUILD_TESTING" OFF)
69 CMAKE_DEPENDENT_OPTION(BUILD_COMM_TESTS "Build comm related tests (require comm port)" OFF "BUILD_TESTING" OFF)
70
71 option(WITH_SAMPLE "Build sample code" OFF)
72
73 option(WITH_CLIENT_COMMON "Build client common library" ON)
74 CMAKE_DEPENDENT_OPTION(WITH_CLIENT "Build client binaries" ON "WITH_CLIENT_COMMON" OFF)
75
76 option(WITH_SERVER "Build server binaries" OFF)
77
78 option(BUILTIN_CHANNELS "Combine all channels into their respective base library" ON)
79
80 option(WITH_CHANNELS "Build virtual channel plugins" ON)
81
82 option(WITH_WINPR_TOOLS "Build WinPR helper binaries" ON)
83
84 CMAKE_DEPENDENT_OPTION(WITH_CLIENT_CHANNELS "Build virtual channel plugins" ON
85         "WITH_CLIENT_COMMON;WITH_CHANNELS" OFF)
86
87 CMAKE_DEPENDENT_OPTION(WITH_MACAUDIO "Enable OSX sound backend" ON "APPLE;NOT IOS" OFF)
88
89 if(WITH_SERVER AND WITH_CHANNELS)
90         option(WITH_SERVER_CHANNELS "Build virtual channel plugins" ON)
91 endif()
92
93 option(WITH_THIRD_PARTY "Build third-party components" OFF)
94
95 option(WITH_CLIENT_INTERFACE "Build clients as a library with an interface" OFF)
96 option(WITH_SERVER_INTERFACE "Build servers as a library with an interface" ON)
97
98 option(WITH_DEBUG_ALL "Print all debug messages." OFF)
99
100 if(WITH_DEBUG_ALL)
101     message(WARNING "WITH_DEBUG_ALL=ON, the build will be slow and might leak sensitive information, do not use with release builds!")
102         set(DEFAULT_DEBUG_OPTION "ON")
103 else()
104         set(DEFAULT_DEBUG_OPTION "OFF")
105 endif()
106
107 option(WITH_DEBUG_CERTIFICATE "Print certificate related debug messages." ${DEFAULT_DEBUG_OPTION})
108 if(WITH_DEBUG_CERTIFICATE)
109     message(WARNING "WITH_DEBUG_CERTIFICATE=ON, the build might leak sensitive information, do not use with release builds!")
110 endif()
111 option(WITH_DEBUG_CAPABILITIES "Print capability negotiation debug messages." ${DEFAULT_DEBUG_OPTION})
112 option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." ${DEFAULT_DEBUG_OPTION})
113 option(WITH_DEBUG_CLIPRDR "Print clipboard redirection debug messages" ${DEFAULT_DEBUG_OPTION})
114 option(WITH_DEBUG_RDPGFX "Print RDPGFX debug messages" ${DEFAULT_DEBUG_OPTION})
115 option(WITH_DEBUG_DVC "Print dynamic virtual channel debug messages." ${DEFAULT_DEBUG_OPTION})
116 CMAKE_DEPENDENT_OPTION(WITH_DEBUG_TSMF "Print TSMF virtual channel debug messages." ${DEFAULT_DEBUG_OPTION} "CHANNEL_TSMF" OFF)
117 option(WITH_DEBUG_KBD "Print keyboard related debug messages." OFF)
118 if(WITH_DEBUG_KBD)
119     message(WARNING "WITH_DEBUG_KBD=ON, the build might leak sensitive information, do not use with release builds!")
120 endif()
121 option(WITH_DEBUG_LICENSE "Print license debug messages." OFF)
122 if(WITH_DEBUG_LICENSE)
123     message(WARNING "WITH_DEBUG_LICENSE=ON, the build might leak sensitive information, do not use with release builds!")
124 endif()
125 option(WITH_DEBUG_NEGO "Print negotiation related debug messages." OFF)
126 if(WITH_DEBUG_NEGO)
127     message(WARNING "WITH_DEBUG_NEGO=ON, the build might leak sensitive information, do not use with release builds!")
128 endif()
129 option(WITH_DEBUG_NLA "Print authentication related debug messages." OFF)
130 if(WITH_DEBUG_NLA)
131     message(WARNING "WITH_DEBUG_NLA=ON, the build might leak sensitive information, do not use with release builds!")
132 endif()
133 option(WITH_DEBUG_NTLM "Print NTLM debug messages" OFF)
134 if(WITH_DEBUG_NTLM)
135     message(WARNING "WITH_DEBUG_NTLM=ON, the build might leak sensitive information, do not use with release builds!")
136 endif()
137 option(WITH_DEBUG_TSG "Print Terminal Server Gateway debug messages" ${DEFAULT_DEBUG_OPTION})
138 option(WITH_DEBUG_RAIL "Print RemoteApp debug messages" ${DEFAULT_DEBUG_OPTION})
139 option(WITH_DEBUG_RDP "Print RDP debug messages" ${DEFAULT_DEBUG_OPTION})
140 option(WITH_DEBUG_RDPEI "Print input virtual channel debug messages" ${DEFAULT_DEBUG_OPTION})
141 option(WITH_DEBUG_REDIR "Redirection debug messages" ${DEFAULT_DEBUG_OPTION})
142 option(WITH_DEBUG_RDPDR "Rdpdr debug messages" ${DEFAULT_DEBUG_OPTION})
143 option(WITH_DEBUG_RFX "Print RemoteFX debug messages." ${DEFAULT_DEBUG_OPTION})
144 option(WITH_DEBUG_SCARD "Print smartcard debug messages" ${DEFAULT_DEBUG_OPTION})
145 option(WITH_DEBUG_SND "Print rdpsnd debug messages" ${DEFAULT_DEBUG_OPTION})
146 option(WITH_DEBUG_SVC "Print static virtual channel debug messages." ${DEFAULT_DEBUG_OPTION})
147 option(WITH_DEBUG_TRANSPORT "Print transport debug messages." ${DEFAULT_DEBUG_OPTION})
148 option(WITH_DEBUG_THREADS "Print thread debug messages, enables handle dump" ${DEFAULT_DEBUG_OPTION})
149 option(WITH_DEBUG_MUTEX "Print mutex debug messages" ${DEFAULT_DEBUG_OPTION})
150 option(WITH_DEBUG_TIMEZONE "Print timezone debug messages." ${DEFAULT_DEBUG_OPTION})
151 option(WITH_DEBUG_WND "Print window order debug messages" ${DEFAULT_DEBUG_OPTION})
152 option(WITH_DEBUG_X11_CLIPRDR "Print X11 clipboard redirection debug messages" ${DEFAULT_DEBUG_OPTION})
153 option(WITH_DEBUG_X11_LOCAL_MOVESIZE "Print X11 Client local movesize debug messages" ${DEFAULT_DEBUG_OPTION})
154 option(WITH_DEBUG_X11 "Print X11 Client debug messages" ${DEFAULT_DEBUG_OPTION})
155 option(WITH_DEBUG_XV "Print XVideo debug messages" ${DEFAULT_DEBUG_OPTION})
156 option(WITH_DEBUG_RINGBUFFER "Enable Ringbuffer debug messages" ${DEFAULT_DEBUG_OPTION})
157
158 option(WITH_DEBUG_SYMBOLS "Pack debug symbols to installer" OFF)
159 option(WITH_CCACHE "Use ccache support if available" ON)
160 option(WITH_CLANG_FORMAT "Detect clang-format. run 'cmake --build . --target clangformat' to format." ON)
161 option(WITH_ICU "Use ICU for unicode conversion" OFF)
162 option(WITH_GSSAPI "Compile support for kerberos authentication. (EXPERIMENTAL)" OFF)
163
164 option(WITH_DSP_EXPERIMENTAL "Enable experimental sound encoder/decoder formats" OFF)
165 if (WITH_FFMPEG)
166     option(WITH_DSP_FFMPEG "Use FFMPEG for audio encoding/decoding" OFF)
167     option(WITH_VAAPI "Use FFMPEG VAAPI (EXPERIMENTAL)" OFF)
168 endif(WITH_FFMPEG)
169
170 option(USE_VERSION_FROM_GIT_TAG "Extract FreeRDP version from git tag." OFF)
171
172 option(WITH_CAIRO    "Use CAIRO image library for screen resizing" OFF)
173 option(WITH_SWSCALE  "Use SWScale image library for screen resizing" OFF)
174
175 option(DEFINE_NO_DEPRECATED "Compile without legacy functions and symbols" OFF)
176
177 if (ANDROID)
178         include(ConfigOptionsAndroid)
179 endif(ANDROID)
180
181 if (IOS)
182         include(ConfigOptionsiOS)
183 endif(IOS)