blob: 140cae7c80fb583a4066d84a36d88955a9078d88 [file] [log] [blame]
Jose Fonseca2ea5a0d2016-03-22 10:42:55 +00001[![Build Status](https://travis-ci.org/apitrace/apitrace.svg?branch=master)](https://travis-ci.org/apitrace/apitrace)
2[![Build status](https://ci.appveyor.com/api/projects/status/5da6kauyfvclv6y0/branch/master?svg=true)](https://ci.appveyor.com/project/jrfonseca/apitrace/branch/master)
3
4
José Fonsecaaa8d2562014-06-17 19:25:20 +01005# Requirements #
José Fonseca8d6f8f32011-09-27 08:54:45 +01006
José Fonseca6d617002011-09-06 01:17:48 +01007Requirements common for all platforms:
8
anatoly techtonikfbceb852016-01-17 14:24:10 +03009* C++ compiler
10
Jose Fonseca7c3f3912020-05-08 15:26:27 +010011* Python version 3.6 or newer
José Fonseca6d617002011-09-06 01:17:48 +010012
José Fonseca0e3c21c2011-12-11 10:58:14 +000013 * Python Image Library
14
José Fonsecae9242602015-03-09 11:04:53 +000015* CMake version 2.8.11 or higher (tested with version 2.8.12.2)
José Fonseca6d617002011-09-06 01:17:48 +010016
anatoly techtonikfbceb852016-01-17 14:24:10 +030017Optional dependencies:
Jose Fonseca63e5f392015-03-15 10:33:32 +000018
Jose Fonseca33d5be12015-03-15 19:09:13 +000019* zlib 1.2.6 or higher
Jose Fonseca63e5f392015-03-15 10:33:32 +000020
21* libpng
José Fonseca6d617002011-09-06 01:17:48 +010022
José Fonseca8d6f8f32011-09-27 08:54:45 +010023The GUI also dependends on:
José Fonseca6d617002011-09-06 01:17:48 +010024
José Fonsecaf757adb2015-01-15 18:40:49 +000025* Qt version 5.2.1 or higher (tested with version 5.4.0 and 5.3.0; use the
José Fonseca00240952015-01-15 19:14:41 +000026 [6.1 release](https://github.com/apitrace/apitrace/releases/tag/6.1), if you
José Fonsecaf757adb2015-01-15 18:40:49 +000027 must build with Qt4)
José Fonseca8d6f8f32011-09-27 08:54:45 +010028
José Fonseca3f4cd302015-01-14 12:02:06 +000029Qt will be required if `-DENABLE_GUI=TRUE` is passed to CMake, and never used
30if `-DENABLE_GUI=FALSE` is passed instead. The implicit default is
31`-DENABLE_GUI=AUTO`, which will build the GUI if Qt is available.
José Fonseca8d6f8f32011-09-27 08:54:45 +010032
Jose Fonsecaccbd7492016-02-26 13:34:16 +000033If you have Qt in a non-standard directory, you'll need to set
34[`-DCMAKE_PREFIX_PATH`](http://doc.qt.io/qt-5/cmake-manual.html).
35
José Fonseca8d6f8f32011-09-27 08:54:45 +010036
Jose Fonseca63e5f392015-03-15 10:33:32 +000037The code also depends on snappy libraries, but the bundled sources are always
38used regardless of system availability, to make the wrapper shared-objects/DLL
39self contained, and to prevent symbol collisions when tracing.
José Fonseca6d617002011-09-06 01:17:48 +010040
41
José Fonseca3f4cd302015-01-14 12:02:06 +000042# Linux #
José Fonseca6d617002011-09-06 01:17:48 +010043
anatoly techtonikfbceb852016-01-17 14:24:10 +030044Optional dependencies:
45
46* Xlib headers
José Fonsecab0d27172013-06-01 10:28:07 +010047
48* libprocps (procps development libraries)
49
50* libdwarf
51
José Fonseca6d617002011-09-06 01:17:48 +010052Build as:
53
José Fonsecaebfd69b2013-06-11 14:15:35 +010054 cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo
José Fonseca6d617002011-09-06 01:17:48 +010055 make -C build
56
José Fonsecaebfd69b2013-06-11 14:15:35 +010057Other possible values for `CMAKE_BUILD_TYPE` `Debug`, `Release`,
58`RelWithDebInfo`, and `MinSizeRel`.
José Fonseca12d1fc12012-10-17 12:19:36 +010059
60You can also build the 32-bits GL wrapper on a 64-bits distribution, provided
61you have a multilib gcc and 32-bits X11 libraries, by doing:
José Fonseca6d617002011-09-06 01:17:48 +010062
José Fonseca2defc1f2012-08-13 13:50:15 +010063 cmake \
José Fonsecaeb76c2a2015-01-20 11:11:37 +000064 -H. -Bbuild32 \
José Fonseca2defc1f2012-08-13 13:50:15 +010065 -DCMAKE_C_FLAGS=-m32 \
66 -DCMAKE_CXX_FLAGS=-m32 \
José Fonseca31278e92012-09-26 16:14:22 +010067 -DCMAKE_SYSTEM_LIBRARY_PATH=/usr/lib32 \
José Fonsecaeb76c2a2015-01-20 11:11:37 +000068 -DENABLE_GUI=FALSE
José Fonseca6d617002011-09-06 01:17:48 +010069 make -C build32 glxtrace
70
José Fonseca12d1fc12012-10-17 12:19:36 +010071The `/usr/lib32` refers to the path where the 32-bits shared objects are may
72differ depending on the actual Linux distribution.
73
74
José Fonseca3f4cd302015-01-14 12:02:06 +000075# Mac OS X #
76
Jose Fonseca92803d72018-01-03 11:11:20 +000077First install Qt through [Homebrew](https://brew.sh/) like
José Fonseca3f4cd302015-01-14 12:02:06 +000078
Jose Fonseca92803d72018-01-03 11:11:20 +000079 brew install qt5
80
81Then do:
82
83 cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=$(brew --prefix qt5)
José Fonseca3f4cd302015-01-14 12:02:06 +000084 make -C build
85
86
José Fonsecaaa8d2562014-06-17 19:25:20 +010087# Android #
George Wrighta4a643e2012-02-23 14:54:49 -050088
Jose Fonseca22645462017-06-03 21:59:09 +010089Android is no longer supported. See https://git.io/vH2gW for more information.
BogDan Vatra919a3d72015-01-29 16:36:52 +020090
José Fonsecad01f8372013-02-05 11:44:26 +000091
José Fonsecaaa8d2562014-06-17 19:25:20 +010092# Windows #
93
94## Microsoft Visual Studio ##
José Fonseca6d617002011-09-06 01:17:48 +010095
96Additional requirements:
97
Jose Fonseca67f05812017-10-05 15:09:30 +010098* CMake 3.7 or later
Jose Fonsecad335cfb2016-04-08 17:37:30 +010099
Jose Fonseca7c3f3912020-05-08 15:26:27 +0100100* Microsoft Visual Studio 2017 or later (tested with 2019)
José Fonseca6d617002011-09-06 01:17:48 +0100101
Jose Fonseca4713c3b2015-08-12 11:06:34 +0100102* [Windows 10 SDK](https://dev.windows.com/en-us/downloads/windows-10-sdk)
103 for D3D11.3 headers.
José Fonseca072d09b2014-11-27 18:13:04 +0000104
EoD06e20a62016-01-17 19:58:54 +0100105### CMake GUI ###
106
Jose Fonseca2bb81362016-04-23 23:59:11 +0100107To build with Visual Studio first open a Command Prompt window (*not* Visual
108Studio Command Prompt window), change into the Apitrace source, and invoke
109CMake GUI as:
José Fonseca6d617002011-09-06 01:17:48 +0100110
Jose Fonseca7c3f3912020-05-08 15:26:27 +0100111 cmake-gui -H. -Bbuild -DCMAKE_PREFIX_PATH=C:\Qt\QtX.Y.Z\X.Y\msvc2017
José Fonseca6d617002011-09-06 01:17:48 +0100112
113and press the _Configure_ button.
114
115It will try to detect most required/optional dependencies automatically. When
116not found automatically, you can manually specify the location of the
José Fonseca8d6f8f32011-09-27 08:54:45 +0100117dependencies from the CMake GUI.
José Fonseca6d617002011-09-06 01:17:48 +0100118
Jose Fonseca8c425412015-06-11 21:45:41 +0100119If the source/build/compiler/tools are spread across multiple drives, you might
120need to [use absolute paths](https://github.com/apitrace/apitrace/issues/352).
121
José Fonseca1d6bed02011-10-23 11:07:38 +0100122After you've successfully configured, you can start the build by opening the
EoD06e20a62016-01-17 19:58:54 +0100123generated `build\apitrace.sln` solution file
José Fonseca6d617002011-09-06 01:17:48 +0100124
EoD06e20a62016-01-17 19:58:54 +0100125### CMake CLI ###
126
127Another option is to use the commandline to configure the project. First of all find out which
128generators are available on your system:
129
130 cmake --help
131
132At the end of the output, choose a generator and start configuring the project:
133
Jose Fonseca7c3f3912020-05-08 15:26:27 +0100134 cmake -H. -Bbuild -G "Visual Studio 16 2019" -A Win32 -DCMAKE_PREFIX_PATH=C:\Qt\QtX.Y.Z\X.Y\msvc2017
Jose Fonseca67f05812017-10-05 15:09:30 +0100135
Jose Fonseca7c3f3912020-05-08 15:26:27 +0100136Note as off Qt version 5.9.1 there's no `msvc2019` directory, only `msvc2017`
137and `msvc2017_64`, but `msvc2017` should work as MSVC 2019 is binary backwards
138compatible with MSVC 2017.
EoD06e20a62016-01-17 19:58:54 +0100139
EoD06e20a62016-01-17 19:58:54 +0100140After you've successfully configured, you can start the build by invoking CMake as:
141
Jose Fonsecad335cfb2016-04-08 17:37:30 +0100142 cmake --build build --config RelWithDebInfo
EoD06e20a62016-01-17 19:58:54 +0100143
144### Deployment ###
145
Jose Fonseca67f05812017-10-05 15:09:30 +0100146To run qapitrace, either ensure that `C:\Qt\QtX.Y.Z\X.Y\msvc????\bin` is in the system path, or use
EoD06e20a62016-01-17 19:58:54 +0100147[Qt's Windows deployment tool](http://doc.qt.io/qt-5/windows-deployment.html#the-windows-deployment-tool)
148to copy all necessary DLLs, like:
Jose Fonseca53517af2015-05-21 16:30:46 +0100149
Jose Fonseca7c3f3912020-05-08 15:26:27 +0100150 set Path=C:\Qt\QtX.Y.Z\X.Y\msvc2017\bin;%Path%
Jose Fonseca53517af2015-05-21 16:30:46 +0100151 windeployqt build\qapitrace.exe
152
Jose Fonseca9eb14752016-01-17 22:24:04 +0000153### 64-bits ###
154
Jose Fonseca7c3f3912020-05-08 15:26:27 +0100155The steps to build 64-bits version are similar, but choosing `-A x64` instead
156of `-A Win32`, and using `C:\Qt\QtX.Y.Z\X.Y\msvc2017_64` for Qt path.
Jose Fonseca9eb14752016-01-17 22:24:04 +0000157
158### Windows XP ###
159
Jose Fonseca16b76a22017-03-20 12:50:52 +0000160Windows XP is no longer supported. If you need Windows XP support, your best
Jose Fonseca7c3f3912020-05-08 15:26:27 +0100161bet is to user an [older version of the code](https://github.com/apitrace/apitrace/tree/windows-xp).
Jose Fonseca9eb14752016-01-17 22:24:04 +0000162
José Fonsecaaa8d2562014-06-17 19:25:20 +0100163## MinGW ##
164
165Additional requirements:
166
Jose Fonseca9eb14752016-01-17 22:24:04 +0000167* [MinGW-w64](http://mingw-w64.sourceforge.net/) (tested with mingw-w64's gcc version 4.9)
José Fonsecaaa8d2562014-06-17 19:25:20 +0100168
EoD111f2f62016-01-17 13:03:16 +0100169* [DirectX headers](https://github.com/apitrace/dxsdk)
José Fonsecaaa8d2562014-06-17 19:25:20 +0100170
José Fonseca27dbbe52015-01-20 11:11:56 +0000171It's also possible to cross-compile Windows binaries from Linux with
José Fonseca6d617002011-09-06 01:17:48 +0100172[MinGW cross compilers](http://www.cmake.org/Wiki/CmakeMingw).
173