Fix standalone dEQP build.
authorPyry Haulos <phaulos@google.com>
Wed, 24 Sep 2014 19:12:26 +0000 (12:12 -0700)
committerPyry Haulos <phaulos@google.com>
Wed, 24 Sep 2014 19:12:26 +0000 (12:12 -0700)
Change-Id: I3ed9c3bdb4298a092e0b4f55f38f052e0a60c9fa

.gitignore [new file with mode: 0644]
CMakeLists.txt
android/.gitignore
android/scripts/build.py
external/libpng/CMakeLists.txt [new file with mode: 0644]
external/zlib/CMakeLists.txt [new file with mode: 0644]
framework/common/CMakeLists.txt
framework/delibs/CMakeLists.txt [deleted file]
framework/qphelper/CMakeLists.txt
framework/qphelper/qpTestLog.c

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..2f836aa
--- /dev/null
@@ -0,0 +1,2 @@
+*~
+*.pyc
index bbb977d..f04916c 100644 (file)
@@ -56,6 +56,30 @@ include_directories(
 # Include target-specific definitions
 include(targets/${DEQP_TARGET}/${DEQP_TARGET}.cmake)
 
+# zlib
+find_path(ZLIB_INCLUDE_PATH    zlib.h)
+find_library(ZLIB_LIBRARY      z)
+
+if (NOT ZLIB_INCLUDE_PATH OR NOT ZLIB_LIBRARY)
+       message(STATUS "System version of zlib not found, using external/zlib")
+       add_subdirectory(external/zlib)
+       # \note ZLIB_LIBRARY and ZLIB_INCLUDE_PATH are promoted from external/zlib/CMakeLists.txt
+endif ()
+
+include_directories(${ZLIB_INCLUDE_PATH})
+
+# libpng
+find_path(PNG_INCLUDE_PATH     libpng.h)
+find_library(PNG_LIBRARY       png)
+
+if (NOT PNG_INCLUDE_PATH OR NOT PNG_LIBRARY)
+       message(STATUS "System version of libpng not found, using external/libpng")
+       add_subdirectory(external/libpng)
+       # \note PNG_LIBRARY and PNG_INCLUDE_PATH are promoted from external/libpng/CMakeLists.txt
+endif ()
+
+include_directories(${PNG_INCLUDE_PATH})
+
 # \todo [2013-04-14 pyry] Remove once we've got dynamic loading of GL libraries figured out
 if (DEQP_RUNTIME_LINK)
        include_directories(wrappers/dynlib/inc)
index 2cdeba2..c8aa7c4 100644 (file)
@@ -9,3 +9,4 @@ proguard.cfg
 project.properties
 proguard-project.txt
 debug
+build
index cfd703b..12419cc 100644 (file)
@@ -26,7 +26,7 @@ def getStoreKeyPasswords (filename):
 
 def getNativeBuildDir (nativeLib, buildType):
        deqpDir = os.path.normpath(os.path.join(common.ANDROID_DIR, ".."))
-       return os.path.normpath(os.path.join(deqpDir, "..", "deqp-build-android-%d-%s-%s" % (nativeLib.apiVersion, nativeLib.abiVersion, buildType.lower())))
+       return os.path.normpath(os.path.join(deqpDir, "android", "build", "%s-%d-%s" % (buildType.lower(), nativeLib.apiVersion, nativeLib.abiVersion)))
 
 def buildNative (nativeLib, buildType):
        deqpDir         = os.path.normpath(os.path.join(common.ANDROID_DIR, ".."))
diff --git a/external/libpng/CMakeLists.txt b/external/libpng/CMakeLists.txt
new file mode 100644 (file)
index 0000000..923cf4f
--- /dev/null
@@ -0,0 +1,49 @@
+# cmake file for libpng
+
+if (NOT DE_DEFS)
+       message(FATAL_ERROR "Include Defs.cmake")
+endif ()
+
+set(PNG_SRC_PATH "../../../libpng" CACHE STRING "Path to libpng source tree")
+
+set(PNG_SRCS
+       ${PNG_SRC_PATH}/png.h
+       ${PNG_SRC_PATH}/pngconf.h
+       ${PNG_SRC_PATH}/png.c
+       ${PNG_SRC_PATH}/pngset.c
+       ${PNG_SRC_PATH}/pngget.c
+       ${PNG_SRC_PATH}/pngrutil.c
+       ${PNG_SRC_PATH}/pngtrans.c
+       ${PNG_SRC_PATH}/pngwutil.c
+       ${PNG_SRC_PATH}/pngread.c
+       ${PNG_SRC_PATH}/pngrio.c
+       ${PNG_SRC_PATH}/pngwio.c
+       ${PNG_SRC_PATH}/pngwrite.c
+       ${PNG_SRC_PATH}/pngrtran.c
+       ${PNG_SRC_PATH}/pngwtran.c
+       ${PNG_SRC_PATH}/pngmem.c
+       ${PNG_SRC_PATH}/pngerror.c
+       ${PNG_SRC_PATH}/pngpread.c
+       )
+
+if (DE_DEBUG EQUAL 1)
+       add_definitions(-DPNG_DEBUG)
+endif ()
+
+if (DE_OS_IS_UNIX)
+       # for snprintf()
+       add_definitions(-D_XOPEN_SOURCE=600)
+endif ()
+
+set(CMAKE_C_FLAGS ${DE_3RD_PARTY_C_FLAGS})
+
+add_library(png STATIC ${PNG_SRCS})
+target_link_libraries(png ${ZLIB_LIBRARY})
+
+if (IS_ABSOLUTE ${PNG_SRC_PATH})
+       set(PNG_INCLUDE_PATH ${PNG_SRC_PATH} PARENT_SCOPE)
+else ()
+       set(PNG_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${PNG_SRC_PATH}" PARENT_SCOPE)
+endif ()
+
+set(PNG_LIBRARY png PARENT_SCOPE)
diff --git a/external/zlib/CMakeLists.txt b/external/zlib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f5d41b8
--- /dev/null
@@ -0,0 +1,58 @@
+# cmake file for zlib
+
+if (NOT DE_DEFS)
+       message(FATAL_ERROR "Include Defs.cmake")
+endif ()
+
+set(ZLIB_SRC_PATH "../../../zlib/src" CACHE STRING "Path to zlib source tree")
+
+set(ZLIB_SRCS
+       ${ZLIB_SRC_PATH}/adler32.c
+       ${ZLIB_SRC_PATH}/compress.c
+       ${ZLIB_SRC_PATH}/crc32.c
+       ${ZLIB_SRC_PATH}/crc32.h
+       ${ZLIB_SRC_PATH}/deflate.c
+       ${ZLIB_SRC_PATH}/deflate.h
+       ${ZLIB_SRC_PATH}/gzclose.c
+       ${ZLIB_SRC_PATH}/gzguts.h
+       ${ZLIB_SRC_PATH}/gzlib.c
+       ${ZLIB_SRC_PATH}/gzread.c
+       ${ZLIB_SRC_PATH}/gzwrite.c
+       ${ZLIB_SRC_PATH}/infback.c
+       ${ZLIB_SRC_PATH}/inffast.c
+       ${ZLIB_SRC_PATH}/inffast.h
+       ${ZLIB_SRC_PATH}/inffixed.h
+       ${ZLIB_SRC_PATH}/inflate.c
+       ${ZLIB_SRC_PATH}/inflate.h
+       ${ZLIB_SRC_PATH}/inftrees.c
+       ${ZLIB_SRC_PATH}/inftrees.h
+       ${ZLIB_SRC_PATH}/trees.c
+       ${ZLIB_SRC_PATH}/trees.h
+       ${ZLIB_SRC_PATH}/uncompr.c
+       ${ZLIB_SRC_PATH}/zconf.h
+       ${ZLIB_SRC_PATH}/zlib.h
+       ${ZLIB_SRC_PATH}/zutil.c
+       ${ZLIB_SRC_PATH}/zutil.h
+       )
+
+if (DE_COMPILER_IS_MSC)
+       # 4127: conditional expression is constant
+       # 4131: 'x': uses old style declarator
+       # 4242, 4244: conversion from 'x' to 'y', possible loss of data
+       # 4996: deprecated POSIX name
+       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4127 /wd4131 /wd4242 /wd4244 /wd4996")
+endif ()
+
+if (DE_OS_IS_UNIX)
+       add_definitions(-D_XOPEN_SOURCE=600)
+endif ()
+
+add_library(z STATIC ${ZLIB_SRCS})
+
+if (IS_ABSOLUTE ${ZLIB_SRC_PATH})
+       set(ZLIB_INCLUDE_PATH ${ZLIB_SRC_PATH} PARENT_SCOPE)
+else ()
+       set(ZLIB_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${ZLIB_SRC_PATH}" PARENT_SCOPE)
+endif ()
+
+set(ZLIB_LIBRARY z PARENT_SCOPE)
index 154e85d..29a34bc 100644 (file)
@@ -79,6 +79,7 @@ set(TCUTIL_LIBS
        decpp
        qphelper
        dethread
+       ${PNG_LIBRARY}
        )
 
 add_library(tcutil STATIC ${TCUTIL_SRCS})
diff --git a/framework/delibs/CMakeLists.txt b/framework/delibs/CMakeLists.txt
deleted file mode 100644 (file)
index ad03200..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#-------------------------------------------------------------------------
-# drawElements CMake utilities
-# ----------------------------
-#
-# Copyright 2014 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#-------------------------------------------------------------------------
-
-cmake_minimum_required(VERSION 2.6)
-
-project(delibs)
-
-include(cmake/Defs.cmake NO_POLICY_SCOPE)
-include(cmake/CFlags.cmake)
-
-# Internal library projects.
-add_subdirectory(debase)
-add_subdirectory(depool)
-add_subdirectory(dethread)
-add_subdirectory(deimage)
-add_subdirectory(deutil)
-add_subdirectory(destream)
-
-# External library projects.
-add_subdirectory(zlib)
-add_subdirectory(libpng)
-add_subdirectory(libzip)
index 7b9b8d3..56ec7fb 100644 (file)
@@ -22,7 +22,7 @@ set(QPHELPER_LIBS
        depool
        dethread
        deutil
-       libpng
+       ${PNG_LIBRARY}
        )
 
 if (DE_OS_IS_UNIX)
index 5532f9b..9fe4716 100644 (file)
@@ -33,7 +33,7 @@
 #include "deMutex.h"
 
 #if defined(QP_SUPPORT_PNG)
-#      include "png.h"
+#      include <png.h>
 #endif
 
 #include <stdio.h>