diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b924571..5121bd5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,13 +43,16 @@ jobs: with: version: ${{ env.QT_VERSION }} - # Windows - - - name: Chocolatey Action + - name: Install pkgconfiglite if: matrix.os == 'windows-latest' uses: crazy-max/ghaction-chocolatey@v2 with: args: install pkgconfiglite --checksum e87b5ea3c9142256af60f2d5b917aa63b571e6a0 --checksum-type sha1 + - name: Install nsis + if: matrix.os == 'windows-latest' + uses: crazy-max/ghaction-chocolatey@v2 + with: + args: install nsis - name: Install Debian packaging dependencies if: matrix.os == 'ubuntu-latest' @@ -191,6 +194,11 @@ jobs: uses: crazy-max/ghaction-chocolatey@v2 with: args: install pkgconfiglite --checksum e87b5ea3c9142256af60f2d5b917aa63b571e6a0 --checksum-type sha1 + - name: Install nsis + if: matrix.os == 'windows-latest' + uses: crazy-max/ghaction-chocolatey@v2 + with: + args: install nsis - name: Configure Qtk Library shell: bash diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index f461a2a..89a6fbb 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -39,7 +39,7 @@ jobs: # Check the entire repo for source files to tidy files-changed-only: false # Ignore qtk build and external assimp directories - ignore: '.github|build|extern/assimp/assimp' + ignore: '.github|build|extern' # Point to compile_commands.json produced by build database: 'build' # Use thread comments as feedback @@ -61,8 +61,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: clang-format Check - uses: jidicula/clang-format-action@v4.9.0 + - uses: cpp-linter/cpp-linter-action@v2 with: - clang-format-version: '18' - check-path: ${{ matrix.path }} + version: '18' + style: 'file' + tidy-checks: '' + files-changed-only: false + ignore: '.github|build|extern' + extensions: 'cpp,h' + files: ${{ matrix.path }} diff --git a/CMakeLists.txt b/CMakeLists.txt index da5cb99..378f6b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,8 +157,15 @@ list(APPEND VAR_NAMES QT6_INSTALL_PLUGINS) # Find Assimp. if(QTK_SUBMODULES) - # Required to statically link. - add_compile_options(-fPIC) + if(APPLE) + # Avoid zlib redefining fdopen, causing build failures in apple clang. + # https://github.com/assimp/assimp/issues/6118 + add_compile_definitions(-Dfdopen=fdopen) + endif() + if(NOT WIN32) + # Required to statically link. + add_compile_options(-fPIC) + endif() set(BUILD_SHARED_LIBS OFF CACHE STRING "Build static assimp libs" FORCE) set(ASSIMP_BUILD_ZLIB ON CACHE STRING "Build Zlib with assimp." FORCE) set( @@ -175,6 +182,14 @@ if(QTK_SUBMODULES) "${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/" EXCLUDE_FROM_ALL ) + install( + TARGETS assimp zlibstatic + EXPORT qtk_export + COMPONENT qtk + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ) else() find_package(assimp REQUIRED) endif() diff --git a/README.md b/README.md index 41d700e..c884041 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ The Ubuntu apt repositories contain all the packages we need to build all target To build Qtk desktop application with the scene in the screenshots below run the following commands. ```bash -sudo apt update && sudo apt install cmake build-essential git ccache libxkbcommon-dev libassimp-dev qt6-base-dev qt6-tools-dev +sudo apt update && sudo apt install cmake build-essential git ccache libxkbcommon-dev libassimp-dev qt6-base-dev qt6-tools-dev zlib1g-dev cmake -DQTK_GUI_SCENE=ON -B build cmake --build build ./build/bin/qtk_gui diff --git a/extern/assimp/assimp b/extern/assimp/assimp index 5d5496f..e0b5234 160000 --- a/extern/assimp/assimp +++ b/extern/assimp/assimp @@ -1 +1 @@ -Subproject commit 5d5496f1ad895297cede723b3c96b513263f82ed +Subproject commit e0b52347c6e52de2827ec957a9ebf00ce3c54f79 diff --git a/src/qtk/shaders.h b/src/qtk/shaders.h index 2dc6ff4..57c5a45 100644 --- a/src/qtk/shaders.h +++ b/src/qtk/shaders.h @@ -109,11 +109,12 @@ void main() #version 330 uniform samplerCube uTexture; -varying vec3 vTexCoord; +in vec3 vTexCoord; +out vec4 FragColor; void main() { - gl_FragColor = texture(uTexture, vTexCoord); + FragColor = texture(uTexture, vTexCoord); } )"