[aseprite] 17/128: Refactoring CMake invocations
Tobias Hansen
thansen at moszumanska.debian.org
Mon May 9 21:24:18 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit b5f63d428c816357543b40d3173e0a645cc27b96
Author: Azamat H. Hackimov <azamat.hackimov at gmail.com>
Date: Mon Apr 18 22:55:43 2016 +0500
Refactoring CMake invocations
Using built-in function and modules for checking.
---
src/base/CMakeLists.txt | 41 ++++++++-----------------------------
third_party/modp_b64/CMakeLists.txt | 9 +++-----
2 files changed, 12 insertions(+), 38 deletions(-)
diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt
index 4b422f1..4c90568 100644
--- a/src/base/CMakeLists.txt
+++ b/src/base/CMakeLists.txt
@@ -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
diff --git a/third_party/modp_b64/CMakeLists.txt b/third_party/modp_b64/CMakeLists.txt
index 0af4298..e06af1d 100644
--- a/third_party/modp_b64/CMakeLists.txt
+++ b/third_party/modp_b64/CMakeLists.txt
@@ -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)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list