From 7fb2c40213ebf31fa36545519a971c785ef9975b Mon Sep 17 00:00:00 2001 From: Tanishq Dubey Date: Sun, 16 Jun 2024 16:30:59 -0400 Subject: [PATCH] add debian build and build optimization --- .gitea/workflows/run_build.yaml | 12 ++++++++++++ CMakeLists.txt | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/.gitea/workflows/run_build.yaml b/.gitea/workflows/run_build.yaml index e3772b9..cdccda6 100644 --- a/.gitea/workflows/run_build.yaml +++ b/.gitea/workflows/run_build.yaml @@ -41,3 +41,15 @@ jobs: run: cmake . - name: Build run: cmake --build . + run-build-debian: + container: + image: debian:bookworm + steps: + - name: Install dependencies + run: apt update && apt install --no-install-recommends -y build-essential cmake libsdl2-dev libexiv2-dev mesa-utils nodejs ca-certificates git + - name: Check out repository code + uses: actions/checkout@v4 + - name: Generate build files + run: cmake . + - name: Build + run: cmake --build . diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ce4a22..4ff0d0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required(VERSION 3.10) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) @@ -46,5 +50,9 @@ find_package(OpenGL REQUIRED) find_package(exiv2 REQUIRED) include_directories(${SDL2_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS}) +set(CMAKE_CXX_FLAGS "-Wall -Wextra") +set(CMAKE_CXX_FLAGS_DEBUG "-g") +set(CMAKE_CXX_FLAGS_RELEASE "-O2") + add_executable(tview ${SOURCES}) target_link_libraries(tview ${SDL2_LIBRARIES} ${OPENGL_LIBRARIES} exiv2lib)