From: DRC Date: Tue, 24 May 2011 17:03:51 +0000 (+0000) Subject: Fix build on Windows X-Git-Tag: 1.1.90~69 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4348464a2f7a46cb35f4838f84c2a1efded2ffd1;p=libjpeg-turbo Fix build on Windows git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@636 632fc199-4ca6-4c93-a231-07263d6284db --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c8cd090..2634c42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,17 +193,23 @@ if(WITH_SIMD) add_dependencies(turbojpeg-static simd) endif() -add_executable(jpegut jpegut.c) +add_executable(jpegut jpegut.c tjutil.c) target_link_libraries(jpegut turbojpeg) -add_executable(jpegut-static jpegut.c) +add_executable(jpegut-static jpegut.c tjutil.c) target_link_libraries(jpegut-static turbojpeg-static) -add_executable(jpgtest jpgtest.c bmp.c) -target_link_libraries(jpgtest turbojpeg) +add_executable(jpgtest jpgtest.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c + wrppm.c) +target_link_libraries(jpgtest turbojpeg jpeg) +set_property(TARGET jpgtest PROPERTY COMPILE_FLAGS + "-DBMP_SUPPORTED -DPPM_SUPPORTED") -add_executable(jpgtest-static jpgtest.c bmp.c) -target_link_libraries(jpgtest-static turbojpeg-static) +add_executable(jpgtest-static jpgtest.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c + wrppm.c) +target_link_libraries(jpgtest-static turbojpeg-static jpeg-static) +set_property(TARGET jpgtest-static PROPERTY COMPILE_FLAGS + "-DBMP_SUPPORTED -DPPM_SUPPORTED") add_executable(cjpeg-static cjpeg.c cdjpeg.c rdbmp.c rdgif.c rdppm.c rdswitch.c rdtarga.c) @@ -243,6 +249,7 @@ add_test(TJUnitTest-bi ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.li add_test(TJUnitTest-bi-yuv ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -bi -yuv) endif() add_test(jpegut jpegut) +add_test(jpegut-alloc jpegut -alloc) add_test(jpegut-yuv jpegut -yuv) add_test(cjpeg-int sharedlib/cjpeg -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm) add_test(cjpeg-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.jpg testoutint.jpg) @@ -302,6 +309,7 @@ add_test(jpegtran-crop sharedlib/jpegtran -crop 120x90+20+50 -transpose -perfect add_test(jpegtran-crop-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgcrop.jpg testoutcrop.jpg) add_test(jpegut-static jpegut-static) +add_test(jpegut-static-alloc jpegut-static -alloc) add_test(jpegut-static-yuv jpegut-static -yuv) add_test(cjpeg-static-int cjpeg-static -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testorig.ppm) add_test(cjpeg-static-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimgint.jpg testoutint.jpg) diff --git a/bmp.c b/bmp.c index 01353c7..5d4c58f 100644 --- a/bmp.c +++ b/bmp.c @@ -33,6 +33,7 @@ #include #include #include "cdjpeg.h" +#include "tjutil.h" #include "bmp.h" diff --git a/jpegut.c b/jpegut.c index 115d0cb..c7a6611 100644 --- a/jpegut.c +++ b/jpegut.c @@ -174,11 +174,12 @@ int checkBuf(unsigned char *buf, int w, int h, int pf, int subsamp, { for(col=0; col