Commit Graph

60 Commits

Author SHA1 Message Date
baldurk 51de7255d3 Stop static linking libstdc++ in release builds
* This seemed to cause crashes on some systems as libproxy links to libstdc++
  and can then cause symbol conflicts between the static libstdc++ and the
  system's libstdc++.
* libproxy itself cannot be statically linked, so the solution is either to
  configure Qt without libproxy and break anyone who needs proxy support, or
  stop statically linking libstdc++ and add a new dependency. At commit time
  most distributions have at least g++-5's libstdc++ in their minspec so we can
  require that - the main two that seem to fall short are Debian Jessie and
  CentOS 7. Users on those systems will have to install a newer libstdc++ or
  compile from source rather than using the binary releases.
2019-06-24 13:27:45 +01:00
baldurk 38f0d27901 Use configure_file in CMake to force rebuild if git commit changes
* We also only use GIT_COMMIT_HASH where necessary to avoid rebuilding many
  files for no reason, including splitting version.cpp out into a separate
  project as we do with VS since otherwise changing its preprocessor defines
  rebuilds the whole renderdoc project.
* At the same time, move the git hash to be internal only so we don't have to
  try to link version.cpp into other projects like renderdoccmd or qrenderdoc.
2019-06-20 19:14:14 +01:00
Matias N. Goldberg bea9385bb4 Choose the default qmake as specified by Kits in QtCreator
When QtCreator is used to build a CMake script, it defaults to storing
the qmake to use in the variable "QT_QMAKE_EXECUTABLE"
(this is tweakable in Tools->Options->Kits->CMake generator)

We detect if QT_QMAKE_EXECUTABLE is already defined and if so, use that
setting. Otherwise use the previous default (which is "qmake")

Why this change? A user may have several Qt versions installed, and
QtCreator supports managing between them via the IDE.

Without this change the user will change between kits in the IDE but
Renderdoc will still use the default qmake.

This is problematic in Linux systems because the Qt version installed
via the Qt installer is often more up to date than the distro-provided
one
2019-04-10 08:04:12 -07:00
Matias N. Goldberg cc180e383a Add support for Ninja generator
Fixes baldurk/renderdoc#1126
2019-04-10 08:02:53 -07:00
baldurk 7541dc6bc7 Add cmake compile options for enabling address/thread sanitizer
* Currently tsan doesn't work well in Qt because it doesn't recognise QMutex
2019-02-28 17:48:30 +00:00
baldurk 34a97482dd Add helper shortcut to 'renderdoccmd test' to run functional tests
* This invokes run_tests.py with any arguments but specifies the renderdoc
  module and python module paths automatically. Only works if built within the
  project repo itself as otherwise it won't locate the test script
2019-02-14 15:45:22 +00:00
Jake Turner 8105ddb5ab osx: for cmake set library output to be lib folder
On Apple only set  CMAKE_LIBRARY_OUTPUT_DIRECTORY to be “lib” folder instead of “bin” folder
Fixes osx problem when launching renderdoccmd not being able to find librenderdoc.dylib
RPATH is set to be "@executable_path/../lib" which matches where qrenderdoc.app copies the renderdoc library to

qrenderdoc: set library search folder “-L” to be CMAKE_LIBRARY_OUTPUT_DIRECTORY instead of CMAKE_RUNTIME_OUTPUT_DIRECTORY
2019-01-03 12:21:58 +00:00
baldurk 0c47dc4349 Update swig to renderdoc-modified-6 tag 2018-11-29 00:35:46 +00:00
baldurk 4b82db76e7 Search for python 3.7 as well 2018-11-12 19:26:35 +00:00
baldurk 7f0df0821e On macOS work around broken compilers by disabling inheriting CC & CXX
* Normally we want to inherit CC and CXX from the parent process to ensure that
  the user's choice of compiler is respected. Unfortunately macOS 10.14 starts
  shipping broken compilers, so inheriting CC & CXX causes the swig compilation
  to fail.
* As a workaround, we just disable this on macOS assuming the user won't ever
  want to override CC & CXX because it's all locked into XCode anyway.
2018-10-02 18:26:26 +01:00
baldurk d8a64c4172 Fix compilation on GCC 8. Closes #984 2018-05-15 19:44:17 +01:00
Rémi Verschelde 4a5393b41e CMake: Set SWIG word size based on architecture
Fixes #906.
2018-03-09 12:37:01 +00:00
baldurk e216e2f6b5 Update swig to renderdoc-modified-5 tag 2018-02-26 09:47:18 +00:00
baldurk c1ceb3b02a Make PySide2 optional on windows
* It's already optional on linux due to distributions not necessarily
  carrying packages for it yet. We also make it optional on windows
  since by the same measure it's not a huge problem if it's missing, and
  official builds will include it. This means we don't have to ship the
  binary dependencies
2018-02-02 20:47:19 +00:00
baldurk 6adbdf7dfe Update to 4th set of renderdoc swig changes 2017-12-27 16:05:15 +00:00
baldurk 16f64a5ace Remove use of unnecessary swig generated .py wrappers
* These .py wrappers are relevant for the non-builtin path, but since we
  use -builtin they serve no purpose except to make things more complex.
* So instead we make the module directly exported as 'module' instead of
  '_module'.
* On windows there's no conflict because we have renderdoc.dll vs
  renderdoc.pyd. On linux it's librenderdoc.so vs renderdoc.so.
* To prevent supporting files like .lib / .pdb from conflicting on
  windows we build the python modules into a subdirectory. They're not
  ever used by the UI (it links in the bindings directly).
2017-12-25 15:05:28 +00:00
baldurk b15422f4c1 Re-arrange CMakeLists.txt a bit to separate qrenderdoc & pyrenderdoc
* Now you can build the python modules without building the full UI,
  which is mostly useful for docs builds so we can do a minimal compile
  and still generate the docs.
2017-12-19 18:05:25 +00:00
baldurk fcba572fb2 Don't set -DSWIGWORDSIZE64 on apple, where uint64_t typedef is different 2017-12-14 10:26:25 +00:00
baldurk 1752a96ba9 Specify -DSWIGWORDSIZE64 on linux to fix problems with uint64_t on swig 2017-12-13 22:43:06 +00:00
baldurk 1a514c1310 Attempt to fix weird SWIG compile error with lacking relocatable flag
* Although we're only making binaries so this doesn't seem like it
  should be necessary.
2017-12-07 19:32:23 +00:00
baldurk b8777b3f82 Update to use latest renderdoc SWIG fork, with new improvements
* Enums are now proper python enums instead of just being a class with
  static int members.
* Fix a refcounting issue with SWIG generated code to access nested
  child structs.
2017-11-20 20:01:02 +00:00
baldurk 1992183e8e Add support for specifying a subfolder under the lib/ target. Refs #750
* This allows a buidler to customise from e.g. /usr/lib/librenderdoc.so
  to /usr/lib/renderdoc/librenderdoc.so - which is harmless since the
  library is 'private' and not intended to be linked against directly.
2017-09-26 11:00:17 +01:00
baldurk 4d2da84ca4 Reference an explicit tag release of renderdoc's swig fork
* The tag is signed, and there's a release on that github repo with
  signatures for the source tarball/zip files
2017-08-04 17:35:32 +01:00
baldurk 094b9ebf35 Configure build to work with case fallthrough GCC7 warning. Refs #671 2017-06-22 14:20:23 +01:00
baldurk 91a6bb011b Add cmake option to choose where the forked SWIG source is fetched from 2017-06-22 14:20:22 +01:00
baldurk 63f4bf2d77 Add a cmake option to override the name of the 'qmake' binary. Refs #671 2017-06-22 14:20:21 +01:00
Józef Kucia db0cf0574c Fix check for python-config. Refs #647
Fixes fa1b098cc4.
2017-06-13 06:44:13 -07:00
baldurk fa1b098cc4 Check for python3-config or python3.x-config binary names. Refs #647 2017-06-12 12:11:14 +01:00
baldurk 348bfbce01 CMake recommends finding PythonInterp before PythonLibs 2017-06-09 21:38:52 +01:00
baldurk e4a5b80bdd Don't depend swig targets on renderdoc target, just interface headers
* This avoids rebuilding swig every time if some internal cpp in the
  renderdoc target changes, but will still rebuild it if the interface
  headers change.
2017-05-02 22:58:12 +01:00
baldurk ae50fa99ee Revamp version tagging, remove ugly suffix on git hash. Refs #571
* Tacking -official onto the git hash was a hack only needed on windows,
  and since we want more information it doesn't scale.
* Instead we track anything we need to know about the version in
  separate variables, like whether it's a stable build or a nightly/
  local build. Or if it's built by a downstream distribution then the
  version number for the downstream build.
2017-04-27 19:47:50 +01:00
baldurk 5f2ecd07e4 Don't build python renderdoc modules on OS X 2017-04-19 19:48:34 +01:00
baldurk 8824e18b0a Search share/renderdoc/pylibs for python libs.
* This is only relevant for static qrenderdoc builds where the python
  used isn't the system python, so it needs to locate its libs.
  Otherwise the system libpython3.so and libs will be used.
2017-04-19 18:07:56 +01:00
baldurk 9441e15ebc Make sure linking static python exports all of its symbols
* This is needed to correctly load C modules like math, ctypes, etc
2017-04-19 18:07:55 +01:00
baldurk 94e64a0aec Add build of renderdoc python modules for documentation generation 2017-04-19 18:07:55 +01:00
baldurk 6596a3caec Search for additional python versions 3.4, 3.5, and 3.6 2017-04-19 18:07:54 +01:00
baldurk bd78b4b985 Link against libutil for static qrenderdoc builds
* It's needed for openpty/forkpty in python when static linking, and
  it's a safe library to depend upon dynamically.
2017-04-19 18:07:53 +01:00
baldurk 2e2bd1759d Don't redirect stderr to NULL when configuring, to print errors 2017-04-19 18:07:52 +01:00
baldurk cbc27222e2 Add qrenderdoc python SWIG bindings, for the stable/clean interface 2017-04-18 14:57:43 +01:00
baldurk 2e2a58950a Integrate pyside2/shiboken2 to be able to bind Qt to python
* On linux we make it optional since it's too large a project to add
  as a build step via ExternalProject_add.
2017-04-18 14:57:41 +01:00
baldurk 12472d93bc Link against python in qrenderdoc 2017-04-18 14:57:41 +01:00
baldurk 940d3662eb Add SWIG file to generate python bindings for internal replay API
* SWIG outputs two files - renderdoc_python.cpp with the main actual
  wrapping code, and renderdoc.py a small module that does some
  bootstrapping on python side.
* We use a custom version of SWIG that generates strong/typed enums in
  python based on enum classes, so in cmake we add this custom swig
  fork as an external project and compile it before generating the
  wrappers. On windows there's a committed version of the SWIG binary
  that gets run directly from the .pro or .vcxproj.
* The renderdoc.py gets embedded as a resource on windows or as a C
  generated unsigned char array via include-bin on other platforms, so
  that we can insert it into the python context without needing it to
  sit around on disk somewhere in sys.path
2017-04-18 14:57:40 +01:00
baldurk 2e87ca4531 Require qt creator to locate the cmake project to build on non-windows
* Previously the cmake build would put librenderdoc.so in a /bin folder
  in the source folder so the qt creator project could link against a
  fixed path when just opening the project solo.
* This won't scale though for fetching the SWIG outputs from cmake, and
  it's ugly to modify the source folder for out-of-source builds.
* Instead we have cmake generate a qt creator include file with all of
  the settings and paths needed, and pass the CMAKE_BINARY_DIR into
  qmake when building. This does mean that when opening the project in
  qt creator you need to specify CMAKE_DIR=/path/to/build though.
* As a bonus, this means we can let cmake identify where python is and
  have qt creator link against it rather than having to hardcode include
  paths etc.
2017-04-18 14:57:40 +01:00
baldurk 8ff3ee93b5 Copy libGL force-inclusion hack from renderdoccmd to qrenderdoc
* Normally Qt uses libGL dynamically so this isn't an issue, but if Qt
  is statically linked then we need this.
2017-02-22 17:17:15 +00:00
baldurk 9721a4d1a4 Set up icon and version for OS X packages 2017-02-17 20:16:21 +00:00
baldurk 456b117a76 Don't copy support files as executable programs 2017-02-10 12:41:24 +00:00
baldurk d728a47b99 Use CONFIG += silent to avoid the need to reset MAKEFLAGS
* When cmake custom commands invoke make, the make execution is silent.
  The MAKEFLAGS reset was to remove the silent flag, but it also lost
  the -j parallel build flags.
* Instead, we set qmake to silent mode (which it already was going to
  be), and that causes it to add echo statements to each rule that will
  be printed even when make is silent.
2017-02-09 19:28:23 +00:00
baldurk 89f6fa339b Add NO_CXX11_REGEX define for qrenderdoc building on old compilers 2017-02-01 10:03:46 +00:00
baldurk 28cba09f22 Apply cmake compiler selection into qmake command
* In particular this means that if you compile with clang, qmake won't
  try to use g++.
2017-01-24 22:30:02 +00:00
baldurk 28e5cd6b56 Pass warning flags into qmake when building 2017-01-03 14:23:59 +00:00