Merge branch 'cmake-optima'

This commit is contained in:
David Capello 2016-04-19 14:21:04 -03:00
commit 14ccfed3cc
3 changed files with 14 additions and 40 deletions

View File

@ -12,14 +12,14 @@ env:
before_install:
- if [ "$CXX" = "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
- sudo apt-get update -qq
- if [ "$SHARED" == "ON" ]; then sudo apt-get install -y libcurl4-openssl-dev libgif-dev libjpeg-dev libz-dev libpng-dev libtinyxml-dev libpixman-1-dev liballegro4.2-dev ; fi
- if [ "$SHARED" == "ON" ]; then sudo apt-get install -y libcurl4-openssl-dev libgif-dev libfreetype6-dev libjpeg-dev libz-dev libpng-dev libtinyxml-dev libpixman-1-dev liballegro4.2-dev ; fi
- if [ "$CXX" = "g++" ]; then sudo apt-get install -y -qq g++-4.8; fi
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8"; fi
before_script:
- mkdir build
- cd build
- cmake .. -DUSE_SHARED_CURL=$SHARED -DUSE_SHARED_GIFLIB=$SHARED -DUSE_SHARED_JPEGLIB=$SHARED -DUSE_SHARED_ZLIB=$SHARED -DUSE_SHARED_LIBPNG=$SHARED -DUSE_SHARED_TINYXML=$SHARED -DUSE_SHARED_PIXMAN=$SHARED -DUSE_SHARED_ALLEGRO4=$SHARED -DENABLE_TESTS=ON
- cmake .. -DUSE_SHARED_CURL=$SHARED -DUSE_SHARED_GIFLIB=$SHARED -DUSE_SHARED_FREETYPE=$SHARED -DUSE_SHARED_JPEGLIB=$SHARED -DUSE_SHARED_ZLIB=$SHARED -DUSE_SHARED_LIBPNG=$SHARED -DUSE_SHARED_TINYXML=$SHARED -DUSE_SHARED_PIXMAN=$SHARED -DUSE_SHARED_ALLEGRO4=$SHARED -DENABLE_TESTS=ON
script:
- "make"

View File

@ -1,41 +1,18 @@
# Aseprite Base Library
# Copyright (c) 2001-2016 David Capello
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckCSourceRuns)
include(CheckIncludeFiles)
include(CheckFunctionExists)
include(TestBigEndian)
check_c_source_compiles("
#include <stdint.h>
int main() {
return 0;
}
" HAVE_STDINT_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(dlfcn.h HAVE_DLFCN_H)
check_function_exists(sched_yield HAVE_SCHED_YIELD)
check_c_source_compiles("
#include <unistd.h>
int main() {
sched_yield();
return 0;
}
" HAVE_SCHED_YIELD)
test_big_endian(ASEPRITE_BIG_ENDIAN)
check_c_source_compiles("
#include <dlfcn.h>
int main() {
return 0;
}
" HAVE_DLFCN_H)
check_c_source_runs("
int main() {
unsigned long value = 0x40302010ul;
return (((unsigned char*)&value)[0] == 0x10) ? 0: 1;
}
" ASEPRITE_LITTLE_ENDIAN)
if(NOT ASEPRITE_LITTLE_ENDIAN)
set(ASEPRITE_BIG_ENDIAN TRUE)
if(NOT ASEPRITE_BIG_ENDIAN)
set(ASEPRITE_LITTLE_ENDIAN TRUE)
endif()
# Generate config.h file

View File

@ -1,11 +1,8 @@
# cmake support for modp_b64 by David Capello
check_c_source_runs("
int main() {
unsigned long value = 0x40302010ul;
return (((unsigned char*)&value)[0] != 0x10) ? 0: 1;
}
" WORDS_BIGENDIAN)
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
if(WORDS_BIGENDIAN)
add_definitions(-DWORDS_BIGENDIAN)