Kaynağa Gözat

Add glew to container

Kajetan Johannes Hammerle 1 gün önce
ebeveyn
işleme
ffdaf9353f
4 değiştirilmiş dosya ile 10 ekleme ve 5 silme
  1. 6 1
      CMakeLists.txt
  2. 2 1
      Dockerfile
  3. 1 1
      build_bundle.sh
  4. 1 2
      build_container.sh

+ 6 - 1
CMakeLists.txt

@@ -66,7 +66,12 @@ endif()
 
 add_executable(${PROJECT_NAME} ${SRC})
 add_subdirectory(thirdparty/glfw)
-target_link_libraries(${PROJECT_NAME} PRIVATE glfw GL GLEW)
+if(DOCKER)
+    set(LIBS libGLEW.a)
+else()
+    set(LIBS GLEW)
+endif()
+target_link_libraries(${PROJECT_NAME} PRIVATE glfw GL ${LIBS})
 target_compile_options(${PROJECT_NAME} PUBLIC ${COMPILER_ARGUMENTS})
 
 add_executable(test test/Test.c)

+ 2 - 1
Dockerfile

@@ -8,4 +8,5 @@ RUN apt install -y --no-install-recommends \
         libc-dev \
         libwayland-dev \
         libxkbcommon-dev \
-        xorg-dev
+        xorg-dev \
+        libglew-dev

+ 1 - 1
build_bundle.sh

@@ -1,5 +1,5 @@
 #!/bin/sh
-
+set -e
 cd "$(dirname "$0")"
 ./build_container.sh
 

+ 1 - 2
build_container.sh

@@ -1,5 +1,4 @@
 #!/bin/sh
-
 set -e
 cd "$(dirname "$0")"
 
@@ -7,7 +6,7 @@ podman build . -t builder:latest
 
 podman run -v $PWD:$PWD builder:latest sh -c " \
     cd $PWD
-    cmake -S . -B build_docker -G Ninja -DCMAKE_BUILD_TYPE=Release
+    cmake -S . -B build_docker -G Ninja -DCMAKE_BUILD_TYPE=Release -DDOCKER=true
     ninja -C build_docker
     strip build_docker/basic
     "