diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1975d324..947a980d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -413,7 +413,7 @@ staging:fedora:gcc-amd64-system-libs: libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel mesa-libGL-devel ccache libavcodec-free-devel libavformat-free-devel libavutil-free-devel libswscale-free-devel libasan libubsan wayland-devel libxkbcommon-devel ninja-build xorg-x11-server-Xvfb gawk - mold liblo-devel websocketpp-devel asio-devel + mold liblo-devel asio-devel - mkdir -p ccache - export CCACHE_BASEDIR=${PWD} - export CCACHE_DIR=${PWD}/ccache @@ -442,7 +442,7 @@ staging:archlinux:gcc-amd64-bundled-libs: - pacman -Sy --noconfirm --disable-download-timeout git cmake ninja gcc yasm pkgconfig libxi libxinerama libxrandr libxcursor jsoncpp mesa glm gsl libgphoto2 python3 portaudio zip zlib ffmpeg opencv qt6-base vtk hdf5 glew libxkbcommon fmt make - xorg-server-xvfb mold liblo websocketpp asio + xorg-server-xvfb mold liblo asio - mkdir -p ccache - export CCACHE_BASEDIR=${PWD} - export CCACHE_DIR=${PWD}/ccache @@ -500,7 +500,7 @@ staging:windows: script: - C:\msys64\usr\bin\bash -lc 'pacman -Syuu --noconfirm' - C:\msys64\usr\bin\bash -lc 'pacman -Syuu --noconfirm --needed zip git' - - C:\msys64\usr\bin\bash -lc 'pacman -Syuu --noconfirm --needed mingw-w64-ucrt-x86_64-{cmake,make,gcc,yasm,pkgconf,jsoncpp,glm,gsl,python3,portaudio,zlib,ffmpeg,zeromq,cppzmq,snappy,opencv,gphoto2}' + - C:\msys64\usr\bin\bash -lc 'pacman -Syuu --noconfirm --needed mingw-w64-ucrt-x86_64-{cmake,make,gcc,yasm,pkgconf,jsoncpp,glm,gsl,python3,portaudio,zlib,ffmpeg,zeromq,cppzmq,snappy,opencv,gphoto2,asio}' - C:\msys64\usr\bin\bash -lc 'bash -x ./tools/build_windows' artifacts: name: "splash_windows_installer" @@ -713,7 +713,7 @@ package:windows: script: - C:\msys64\usr\bin\bash -lc 'pacman -Syuu --noconfirm' - C:\msys64\usr\bin\bash -lc 'pacman -Syuu --noconfirm --needed zip git' - - C:\msys64\usr\bin\bash -lc 'pacman -Syuu --noconfirm --needed mingw-w64-ucrt-x86_64-{cmake,make,gcc,yasm,pkgconf,jsoncpp,glm,gsl,python3,portaudio,zlib,ffmpeg,zeromq,cppzmq,snappy,opencv,gphoto2}' + - C:\msys64\usr\bin\bash -lc 'pacman -Syuu --noconfirm --needed mingw-w64-ucrt-x86_64-{cmake,make,gcc,yasm,pkgconf,jsoncpp,glm,gsl,python3,portaudio,zlib,ffmpeg,zeromq,cppzmq,snappy,opencv,gphoto2,asio}' - C:\msys64\usr\bin\bash -lc 'bash -x ./tools/build_windows' artifacts: name: "splash_windows_installer" diff --git a/.gitmodules b/.gitmodules index 5e50c006..39569b05 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,3 +43,6 @@ [submodule "external/imguifiledialog"] path = external/imguifiledialog url = https://github.com/aiekick/ImGuiFileDialog +[submodule "external/websocketpp"] + path = external/websocketpp + url = https://github.com/zaphoyd/websocketpp.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 33066b80..49ae6bd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,8 +100,8 @@ if (BUILD_CODE) # Optional dependencies find_package (Python3 COMPONENTS Interpreter Development) find_package(OpenCV) - find_package(websocketpp) + pkg_search_module(ASIO asio) pkg_search_module(GPHOTO libgphoto2) pkg_search_module(JACK jack) pkg_search_module(LIBLO liblo) @@ -170,7 +170,7 @@ set(HAVE_PORTAUDIO ${PORTAUDIO_FOUND}) set(HAVE_SH4LT ${SH4LT_FOUND}) set(HAVE_SHMDATA ${SHMDATA_FOUND}) set(HAVE_PYTHON ${Python3_FOUND}) -set(HAVE_WEBSOCKETPP ${websocketpp_FOUND}) +set(HAVE_WEBSOCKETPP ${ASIO_FOUND}) set(HAVE_PORTABLE ${WITH_PORTABLE}) if (FFMPEG_libavformat_VERSION LESS 57) @@ -336,7 +336,7 @@ info_cfg_option(Python3_VERSION) info_cfg_option(JSONCPP_VERSION) info_cfg_option(SH4LT_VERSION) info_cfg_option(SHMDATA_VERSION) -info_cfg_option(websocketpp_VERSION) +info_cfg_option(ASIO_VERSION) info_cfg_option(ZMQ_VERSION) info_cfg_option(DOXYGEN_FOUND) info_cfg_option(ZIP) diff --git a/README.md b/README.md index 00e22f5d..2c0c212e 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ Splash relies on a few libraries to get the job done. The mandatory libraries ar - [doctest](https://github.com/onqtam/doctest/) to do some unit testing - [ImGui](https://github.com/ocornut/imgui) to draw the GUI - [stb_image](https://github.com/nothings/stb) to read images + - [Websocket++](https://www.zaphoyd.com/projects/websocketpp/) for Websocket messaging Some other libraries are optional: @@ -72,7 +73,6 @@ Some other libraries are optional: - [portaudio](http://portaudio.com/) to read and output audio - [Python](https://python.org) for scripting capabilities - [GPhoto](http://gphoto.sourceforge.net/) to use a camera for color calibration - - [Websocket++](https://www.zaphoyd.com/projects/websocketpp/) for Websocket messaging - Dependencies built at compile-time from submodules: - [libltc](http://x42.github.io/libltc/) to read timecodes from an audio input @@ -104,7 +104,7 @@ sudo apt install build-essential git-core cmake cmake-extras libxrandr-dev \ libz-dev libxinerama-dev libxcursor-dev python3-dev yasm portaudio19-dev \ python3-numpy libopencv-dev libjsoncpp-dev libavcodec-dev libavformat-dev \ libavutil-dev libswscale-dev ninja-build libwayland-dev libxkbcommon-dev \ - appstream mold patch libdbus-1-dev liblo-dev libwebsocketpp-dev libasio-dev + appstream mold patch libdbus-1-dev liblo-dev libasio-dev # Non mandatory libraries needed to link against system libraries only sudo apt install libglm-dev libsnappy-dev libzmq3-dev diff --git a/external/websocketpp b/external/websocketpp new file mode 160000 index 00000000..b9aeec6e --- /dev/null +++ b/external/websocketpp @@ -0,0 +1 @@ +Subproject commit b9aeec6eaf3d5610503439b4fae3581d9aff08e8 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d6d3527..66099445 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -58,6 +58,12 @@ set_source_files_properties( PROPERTIES COMPILE_FLAGS "-Wno-error -Wno-all -Wno-extra -Wno-unused-parameter -Wno-unused-result" ) +set_source_files_properties( + controller/controller_websocket.cpp + core/scene.cpp + PROPERTIES COMPILE_FLAGS "-Wno-null-pointer-subtraction" +) + set_source_files_properties( graphics/shader.cpp graphics/object.cpp @@ -110,6 +116,7 @@ include_directories(../external/stb) include_directories(../external/tracy/public) include_directories(../external/stduuid/include) include_directories(../external/stduuid) +include_directories(../external/websocketpp) include_directories(${GLFW_INCLUDE_DIRS}) include_directories(${LO_INCLUDE_DIRS}) diff --git a/tools/docker/dockerfile-debian-13 b/tools/docker/dockerfile-debian-13 index 546966b0..40f868cd 100644 --- a/tools/docker/dockerfile-debian-13 +++ b/tools/docker/dockerfile-debian-13 @@ -11,4 +11,4 @@ RUN apt update -qq && apt upgrade -y \ libgl1-mesa-dev libopencv-dev uuid-dev libavcodec-dev libavformat-dev \ libavutil-dev libswscale-dev libsnappy-dev libzmq3-dev libwayland-dev \ libxkbcommon-dev ninja-build pkg-config zip xvfb glslang-tools \ - glslang-dev xauth mold liblo-dev libwebsocketpp-dev libasio-dev + glslang-dev xauth mold liblo-dev libasio-dev diff --git a/tools/docker/dockerfile-ubuntu-24.04 b/tools/docker/dockerfile-ubuntu-24.04 index 1cb1339f..faa28d23 100644 --- a/tools/docker/dockerfile-ubuntu-24.04 +++ b/tools/docker/dockerfile-ubuntu-24.04 @@ -12,4 +12,4 @@ RUN apt update -qq && apt upgrade -y \ uuid-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \ libsnappy-dev libzmq3-dev libwayland-dev libxkbcommon-dev ninja-build \ pkg-config zip xvfb glslang-tools glslang-dev mold liblo-dev \ - libwebsocketpp-dev libasio-dev gcc-14 g++-14 + libasio-dev gcc-14 g++-14 diff --git a/tools/docker/dockerfile-ubuntu-26.04 b/tools/docker/dockerfile-ubuntu-26.04 index c36aff41..6ac3c402 100644 --- a/tools/docker/dockerfile-ubuntu-26.04 +++ b/tools/docker/dockerfile-ubuntu-26.04 @@ -12,4 +12,4 @@ RUN apt update -qq && apt upgrade -y \ uuid-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \ libsnappy-dev libzmq3-dev libwayland-dev libxkbcommon-dev ninja-build \ pkg-config zip xvfb glslang-tools glslang-dev mold liblo-dev \ - libwebsocketpp-dev libasio-dev + libasio-dev