Browse Source

(#103) Use the system's GLFW

rexim 5 năm trước cách đây
mục cha
commit
9e9a547c76
3 tập tin đã thay đổi với 5 bổ sung23 xóa
  1. 3 3
      Makefile
  2. 2 6
      src/vodus_encoder.cpp
  3. 0 14
      third_party/build_third_party.sh

+ 3 - 3
Makefile

@@ -7,9 +7,9 @@ VODUS_EXTRA_CXXFLAGS += -DVODUS_SSE -msse4
 endif
 
 # TODO(#87): we need an option to build with system libraries
-VODUS_PKGS=freetype2 libpcre2-8 gl x11
-VODUS_CXXFLAGS=-Wall -fno-exceptions -std=c++17 $(VODUS_EXTRA_CXXFLAGS) -ggdb `pkg-config --cflags $(VODUS_PKGS)` -I./third_party/ffmpeg-4.3-dist/usr/local/include/ -I./third_party/giflib-5.2.1-dist/usr/local/include/ -I./third_party/glfw-3.3.2-dist/usr/local/include/
-VODUS_LIBS=`pkg-config --libs $(VODUS_PKGS)` -L./third_party/giflib-5.2.1-dist/usr/local/lib/ ./third_party/giflib-5.2.1-dist/usr/local/lib/libgif.a -L./third_party/ffmpeg-4.3-dist/usr/local/lib/ -L./third_party/glfw-3.3.2-dist/usr/local/lib/ -lavcodec -lavutil -lswresample -pthread -lm -llzma -lz -lglfw3 -ldl
+VODUS_PKGS=freetype2 libpcre2-8 glfw3 gl
+VODUS_CXXFLAGS=-Wall -fno-exceptions -std=c++17 $(VODUS_EXTRA_CXXFLAGS) -ggdb `pkg-config --cflags $(VODUS_PKGS)` -I./third_party/ffmpeg-4.3-dist/usr/local/include/ -I./third_party/giflib-5.2.1-dist/usr/local/include/
+VODUS_LIBS=`pkg-config --libs $(VODUS_PKGS)` -L./third_party/giflib-5.2.1-dist/usr/local/lib/ ./third_party/giflib-5.2.1-dist/usr/local/lib/libgif.a -L./third_party/ffmpeg-4.3-dist/usr/local/lib/ -L./third_party/glfw-3.3.2-dist/usr/local/lib/ -lavcodec -lavutil -lswresample -pthread -lm -llzma -lz -ldl
 
 ifeq ($(UNAME), Darwin)
 VODUS_LIBS += -framework AVFoundation -framework VideoToolbox -framework CoreVideo -framework AudioToolbox -framework CoreMedia -framework CoreFoundation -liconv

+ 2 - 6
src/vodus_encoder.cpp

@@ -203,17 +203,13 @@ Preview_Context *new_preview_context(Video_Params params)
     Preview_Context *context = new Preview_Context();
 
     if (!glfwInit()) {
-        const char *description = nullptr;
-        glfwGetError(&description);
-        println(stderr, "Could not initialize GLFW: ", description);
+        println(stderr, "Could not initialize GLFW");
         exit(1);
     }
 
     context->window = glfwCreateWindow(params.width, params.height, "Vodus", NULL, NULL);
     if (!context->window) {
-        const char *description = nullptr;
-        glfwGetError(&description);
-        println(stderr, "Could not create window: ", description);
+        println(stderr, "Could not create GLFW window");
         exit(1);
     }
 

+ 0 - 14
third_party/build_third_party.sh

@@ -5,7 +5,6 @@ set -e
 # TODO(#89): Integrate ./build_third_party.sh into the main build process
 FFMPEG_VERSION=4.3
 GIFLIB_VERSION=5.2.1
-GLFW_VERSION=3.3.2
 MAKE=make
 
 # TODO(#102): ./build_third_party.sh does not respect other BSD's or Darwin that might not use GNU make
@@ -45,16 +44,3 @@ if [ ! -d "giflib-${GIFLIB_VERSION}-dist" ]; then
       DESTDIR="../giflib-${GIFLIB_VERSION}-dist" $MAKE install
     cd ..
 fi
-
-if [ ! -d "glfw-${GLFW_VERSION}-dist" ]; then
-    wget --no-dns-cache "https://github.com/glfw/glfw/releases/download/${GLFW_VERSION}/glfw-${GLFW_VERSION}.zip"
-
-    unzip "glfw-${GLFW_VERSION}.zip"
-    mkdir "glfw-${GLFW_VERSION}-dist"
-
-    cd "glfw-${GLFW_VERSION}"
-      cmake .
-      $MAKE -j5
-      DESTDIR="../glfw-${GLFW_VERSION}-dist" $MAKE install
-    cd ..
-fi