Cross-compiling prototype

This commit is contained in:
JackCarterSmith 2021-06-29 17:54:11 +02:00
parent 4f665d159b
commit 58b120e7bf
4 changed files with 29 additions and 4 deletions

View File

@ -56,4 +56,18 @@ make install
On Windows system, you will probably need to specify the dependency flags for CMake. Ex: On Windows system, you will probably need to specify the dependency flags for CMake. Ex:
`cmake.exe -D"ZLIB_INCLUDE_DIR=zlib/1.2.11/include" -D"ZLIB_LIBRARY=zlib/1.2.11/libzlib.dll.a" -D"PNG_PNG_INCLUDE_DIR=libpng/1.6.37/include" -D"PNG_LIBRARY=libpng/1.6.37/libpng.dll.a" . -G "MinGW Makefiles"` `cmake.exe -D"ZLIB_INCLUDE_DIR=zlib/1.2.11/include" -D"ZLIB_LIBRARY=zlib/1.2.11/lib/libzlib.dll.a" -D"PNG_PNG_INCLUDE_DIR=libpng/1.6.37/include" -D"PNG_LIBRARY=libpng/1.6.37/lib/libpng.dll.a" . -G "MinGW Makefiles"`
We can also use cross-compilation (after installing `mingw64` and `cmake` packages on your distrib):
```shell
mkdir build && cd build
cmake -DGNU_HOST=x86_64-w64-mingw32 \
-DCMAKE_TOOLCHAIN_FILE=../mingw_cross_toolchain.cmake \
-D"ZLIB_INCLUDE_DIR=zlib/1.2.11/include" \
-D"ZLIB_LIBRARY=zlib/1.2.11/lib/libzlib.dll.a" \
-D"PNG_PNG_INCLUDE_DIR=libpng/1.6.37/include" \
-D"PNG_LIBRARY=libpng/1.6.37/lib/libpng.dll.a" \
..
cmake --build .
```

View File

@ -0,0 +1,8 @@
SET(CMAKE_SYSTEM_NAME Windows)
IF("${GNU_HOST}" STREQUAL "")
SET(GNU_HOST i586-mingw32msvc)
ENDIF()
# Prefix detection only works with compiler id "GNU"
SET(CMAKE_C_COMPILER ${GNU_HOST}-gcc)
# CMake doesn't automatically look for prefixed 'windres', do it manually:
SET(CMAKE_RC_COMPILER ${GNU_HOST}-windres)

View File

@ -104,8 +104,11 @@ void convert8bitsTo32bitsRGBA(unsigned char *samples_tab, PIXEL_A *pixels_tab, i
void useOddBytes(unsigned char *src, PIXEL_A *dst, int size) { void useOddBytes(unsigned char *src, PIXEL_A *dst, int size) {
int i; int i;
for(i=0; i<size; i++) { for(i=0; i<(size-1); i++) {
//dst[i] = src[i*2+1]; //dst[i] = src[i*2+1]; //FIXME: Implement optimized byte shifting
//dst[i]._red = src[i*2+1];
//dst[i]._green = src[i*2+1];
//dst[i]._blue = src[i*2+1];
} }
} }

View File

@ -1 +1 @@
#define VERSION "@PROJECT_VERSION@" #define VERSION "@PROJECT_VERSION@"