From 25210dfa526530a8d5db8bb92b5fbc7b4f137238 Mon Sep 17 00:00:00 2001 From: RytoEX Date: Mon, 26 Mar 2018 05:07:14 -0400 Subject: [PATCH] CI and CMake improvements (#205) * CMake: Copy PDB file to OBS build directory on Debug build All native OBS build objects also bundle the associated PDB file for debugging and handling crash reports. * CMake: Add post-build commands for RelWithDebInfo Add post-build commands for the RelWithDebInfo build config. OBS official builds use RelWithDebInfo, so we should be able to treat it as a release config. * CI: Disable building OBS native plugins Use the OBS CMake flag DISABLE_PLUGINS to disable building plugins included with OBS (including submodule plugins like obs-browser). This should speed up builds on Windows when we have to rebuild OBS and on Mac. * CI: Don't clone/update OBS submodules The only submodules presently in OBS are in its plugins, which we don't need to build. * CI: Use obsproject/obs-studio instead of jp9000/obs-studio The OBS GitHub recently changed from jp9000/obs-studio to obsproject/obs-studio, so use that instead. * CI: Build as RelWithDebInfo instead of Release OBS official builds are produced with RelWithDebInfo. This will produce a PDB file for the plugin, similar to the native OBS plugins. * CI(Windows): Build OBS if current build config doesn't exist If OBS libs for the current build config do not exist, build OBS before building obs-websocket. --- CI/build-macos.sh | 1 + CI/install-build-obs.cmd | 17 ++++++++++++++--- CI/install-dependencies-macos.sh | 3 ++- CMakeLists.txt | 31 +++++++++++++++++++++++++++++++ appveyor.yml | 2 +- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/CI/build-macos.sh b/CI/build-macos.sh index 073eb802..561789cf 100755 --- a/CI/build-macos.sh +++ b/CI/build-macos.sh @@ -9,5 +9,6 @@ cmake .. \ -DLIBOBS_INCLUDE_DIR=../../obs-studio/libobs \ -DLIBOBS_LIB=../../obs-studio/libobs \ -DOBS_FRONTEND_LIB="$(pwd)/../../obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX=/usr \ && make -j4 diff --git a/CI/install-build-obs.cmd b/CI/install-build-obs.cmd index 6ab1f3b8..a0748a85 100644 --- a/CI/install-build-obs.cmd +++ b/CI/install-build-obs.cmd @@ -60,13 +60,24 @@ REM If obs-studio directory does not exist, clone the git repo, get the latest REM tag number, and set the build flag. if not exist C:\projects\obs-studio ( echo obs-studio directory does not exist - git clone --recursive https://github.com/jp9000/obs-studio + git clone https://github.com/obsproject/obs-studio cd C:\projects\obs-studio\ git describe --tags --abbrev=0 > C:\projects\obs-studio-latest-tag.txt set /p OBSLatestTag=") + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + "${QTDIR}/bin/Qt5WebSockets.dll" + "${QTDIR}/bin/Qt5Network.dll" + "${CMAKE_BINARY_DIR}/$") + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy "${QTDIR}/bin/Qt5WebSocketsd.dll" "${QTDIR}/bin/Qt5Networkd.dll" @@ -110,6 +115,7 @@ if(WIN32) set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release") add_custom_command(TARGET obs-websocket POST_BUILD + # If config is Release, package release files COMMAND if $==1 ( "${CMAKE_COMMAND}" -E make_directory "${RELEASE_DIR}/data/obs-plugins/obs-websocket" @@ -125,6 +131,26 @@ if(WIN32) "${QTDIR}/bin/Qt5Network.dll" "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + # If config is RelWithDebInfo, package release files + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E make_directory + "${RELEASE_DIR}/data/obs-plugins/obs-websocket" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy_directory + "${PROJECT_SOURCE_DIR}/data" + "${RELEASE_DIR}/data/obs-plugins/obs-websocket") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + "$" + "${QTDIR}/bin/Qt5WebSockets.dll" + "${QTDIR}/bin/Qt5Network.dll" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + "$" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + # Copy to obs-studio dev environment for immediate testing COMMAND if $==1 ( "${CMAKE_COMMAND}" -E copy @@ -133,6 +159,11 @@ if(WIN32) "${QTDIR}/bin/Qt5Networkd.dll" "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy + "$" + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") + COMMAND if $==1 ( "${CMAKE_COMMAND}" -E make_directory "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/data/obs-plugins/obs-websocket") diff --git a/appveyor.yml b/appveyor.yml index bc12cd73..4e3c1888 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ install: - set DepsPath32=%CD%\dependencies2015\win32 - set DepsPath64=%CD%\dependencies2015\win64 - call C:\projects\obs-websocket\CI\install-setup-qt.cmd - - set build_config=Release + - set build_config=RelWithDebInfo - call C:\projects\obs-websocket\CI\install-build-obs.cmd - cd C:\projects\obs-websocket\ - mkdir build32