Compare commits

...

3 Commits

Author SHA1 Message Date
a96aadc867 use gcc 10 2022-06-26 18:34:06 -07:00
29741447cd syntax error 2022-06-26 18:13:38 -07:00
9011718c09 add NOPYTHON option 2022-06-26 18:09:40 -07:00
3 changed files with 50 additions and 9 deletions

View File

@ -18,6 +18,12 @@ jobs:
fetch-depth: 0
submodules: recursive
- name: Set up GCC
if: runner.os == 'linux'
uses: egor-tensin/setup-gcc@v1
with:
version: 10
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
with:
@ -44,7 +50,7 @@ jobs:
- name: Build C side with cmake
run: |
ls
cmake .
cmake . -DQUICKTEX_NOPYTHON=TRUE
cmake --build .
- name: Run C tests

View File

@ -1,7 +1,9 @@
# Find dependencies
find_package(Python COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)
if (NOT QUICKTEX_NOPYTHON)
find_package(Python COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)
endif ()
find_package(OpenMP)
#Collect source files
@ -13,7 +15,7 @@ set(SOURCE_FILES
s3tc/bc4/BC4Block.cpp s3tc/bc4/BC4Decoder.cpp s3tc/bc4/BC4Encoder.cpp
s3tc/bc5/BC5Decoder.cpp s3tc/bc5/BC5Encoder.cpp
s3tc/interpolator/Interpolator.cpp
texture/RawTexture.cpp texture/Window.cpp)
texture/RawTexture.cpp texture/Window.cpp test.cpp)
set(BINDING_FILES
_bindings.cpp
@ -53,9 +55,11 @@ target_include_directories(quicktex PUBLIC .)
set_project_warnings(quicktex)
set_simd_flags(quicktex)
# Declare python module
pybind11_add_module(_quicktex ${BINDING_FILES} ${HEADER_FILES})
target_compile_definitions(_quicktex PRIVATE VERSION_INFO=${QUICKTEX_VERSION_INFO})
if (NOT QUICKTEX_NOPYTHON)
# Declare python module
pybind11_add_module(_quicktex ${BINDING_FILES} ${HEADER_FILES})
target_compile_definitions(_quicktex PRIVATE VERSION_INFO=${QUICKTEX_VERSION_INFO})
# Link python module with implementation
target_link_libraries(_quicktex PUBLIC quicktex)
# Link python module with implementation
target_link_libraries(_quicktex PUBLIC quicktex)
endif ()

31
quicktex/test.cpp Normal file
View File

@ -0,0 +1,31 @@
/* Quicktex Texture Compression Library
Copyright (C) 2021 Andrew Cassidy <drewcassidy@me.com>
Partially derived from rgbcx.h written by Richard Geldreich <richgel99@gmail.com>
and licenced under the public domain
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <array>
#include <cstdint>
#include <xsimd/xsimd.hpp>
#include "Matrix.h"
// Type your code here, or load an example.
namespace quicktex {
auto test(Matrix<float, 4, 1> a, Matrix<float, 4, 1> b, Matrix<float, 4, 1> c) {
return a * 7;
};
} // namespace quicktex