[x265-commits] [x265] version: move export variables into version.cpp
Steve Borho
steve at borho.org
Tue Oct 15 00:58:25 CEST 2013
details: http://hg.videolan.org/x265/rev/eeffa630e770
branches:
changeset: 4446:eeffa630e770
user: Steve Borho <steve at borho.org>
date: Mon Oct 14 13:09:14 2013 -0500
description:
version: move export variables into version.cpp
Subject: [x265] cmake: move X265_BUILD definition to near top of main CMakeLists.txt
details: http://hg.videolan.org/x265/rev/abae6903e0af
branches:
changeset: 4447:abae6903e0af
user: Steve Borho <steve at borho.org>
date: Mon Oct 14 13:12:22 2013 -0500
description:
cmake: move X265_BUILD definition to near top of main CMakeLists.txt
This is just to make it easier to find
diffstat:
source/CMakeLists.txt | 14 +++---
source/common/CMakeLists.txt | 4 +-
source/common/common.cpp | 68 -----------------------------------
source/common/version.cpp | 85 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 94 insertions(+), 77 deletions(-)
diffs (223 lines):
diff -r 28e2a3926c95 -r abae6903e0af source/CMakeLists.txt
--- a/source/CMakeLists.txt Mon Oct 14 12:34:15 2013 -0500
+++ b/source/CMakeLists.txt Mon Oct 14 13:12:22 2013 -0500
@@ -9,6 +9,13 @@ endif()
project (x265)
cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8
+# X265_BUILD must be incremented each time the public API is changed
+set(X265_BUILD 1)
+configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
+ "${PROJECT_BINARY_DIR}/x265.def")
+configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
+ "${PROJECT_BINARY_DIR}/x265_config.h")
+
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
if ("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
@@ -144,13 +151,6 @@ if (WIN32)
endif(WINXP_SUPPORT)
endif()
-# X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 1)
-configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
- "${PROJECT_BINARY_DIR}/x265.def")
-configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
- "${PROJECT_BINARY_DIR}/x265_config.h")
-
include(version) # determine X265_VERSION and X265_LATEST_TAG
include_directories(. Lib common encoder "${PROJECT_BINARY_DIR}")
add_subdirectory(common)
diff -r 28e2a3926c95 -r abae6903e0af source/common/CMakeLists.txt
--- a/source/common/CMakeLists.txt Mon Oct 14 12:34:15 2013 -0500
+++ b/source/common/CMakeLists.txt Mon Oct 14 13:12:22 2013 -0500
@@ -217,7 +217,7 @@ if(GCC)
endif()
set_source_files_properties(cpu.cpp PROPERTIES COMPILE_FLAGS -Wno-narrowing)
endif(GCC)
-add_definitions(-DX265_VERSION=${X265_VERSION})
+set_source_files_properties(version.cpp PROPERTIES COMPILE_FLAGS -DX265_VERSION=${X265_VERSION})
enable_language(ASM_YASM)
add_library(common OBJECT
@@ -225,7 +225,7 @@ add_library(common OBJECT
${ASM_PRIMITIVES} ${VEC_PRIMITIVES}
primitives.cpp primitives.h
pixel.cpp dct.cpp ipfilter.cpp intrapred.cpp
- cpu.cpp cpu.h
+ cpu.cpp cpu.h version.cpp
threading.cpp threading.h
threadpool.cpp threadpool.h
wavefront.h wavefront.cpp
diff -r 28e2a3926c95 -r abae6903e0af source/common/common.cpp
--- a/source/common/common.cpp Mon Oct 14 12:34:15 2013 -0500
+++ b/source/common/common.cpp Mon Oct 14 13:12:22 2013 -0500
@@ -34,12 +34,6 @@
using namespace x265;
-#if HIGH_BIT_DEPTH
-const int x265_max_bit_depth = 8; // 12;
-#else
-const int x265_max_bit_depth = 8;
-#endif
-
#define X265_ALIGNBYTES 32
#if _WIN32
@@ -426,65 +420,3 @@ void x265_print_params(x265_param_t *par
fprintf(stderr, "\n");
fflush(stderr);
}
-
-// ====================================================================================================================
-// Platform information
-// ====================================================================================================================
-
-#define XSTR(x) STR(x)
-#define STR(x) #x
-
-#if defined(__clang__)
-#define NVM_COMPILEDBY "[clang " XSTR(__clang_major__) "." XSTR(__clang_minor__) "." XSTR(__clang_patchlevel__) "]"
-#ifdef __IA64__
-#define NVM_ONARCH "[on 64-bit] "
-#else
-#define NVM_ONARCH "[on 32-bit] "
-#endif
-#endif
-
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
-#define NVM_COMPILEDBY "[GCC " XSTR(__GNUC__) "." XSTR(__GNUC_MINOR__) "." XSTR(__GNUC_PATCHLEVEL__) "]"
-#ifdef __IA64__
-#define NVM_ONARCH "[on 64-bit] "
-#else
-#define NVM_ONARCH "[on 32-bit] "
-#endif
-#endif
-
-#ifdef __INTEL_COMPILER
-#define NVM_COMPILEDBY "[ICC " XSTR(__INTEL_COMPILER) "]"
-#elif _MSC_VER
-#define NVM_COMPILEDBY "[MSVC " XSTR(_MSC_VER) "]"
-#endif
-
-#ifndef NVM_COMPILEDBY
-#define NVM_COMPILEDBY "[Unk-CXX]"
-#endif
-
-#ifdef _WIN32
-#define NVM_ONOS "[Windows]"
-#elif __linux
-#define NVM_ONOS "[Linux]"
-#elif __CYGWIN__
-#define NVM_ONOS "[Cygwin]"
-#elif __APPLE__
-#define NVM_ONOS "[Mac OS X]"
-#else
-#define NVM_ONOS "[Unk-OS]"
-#endif
-
-#if X86_64
-#define NVM_BITS "[64 bit] "
-#else
-#define NVM_BITS "[32 bit] "
-#endif
-
-#if HIGH_BIT_DEPTH
-#define BITDEPTH "16bpp"
-#else
-#define BITDEPTH "8bpp"
-#endif
-
-const char *x265_version_str = XSTR(X265_VERSION);
-const char *x265_build_info_str = NVM_ONOS NVM_COMPILEDBY NVM_BITS BITDEPTH;
diff -r 28e2a3926c95 -r abae6903e0af source/common/version.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/source/common/version.cpp Mon Oct 14 13:12:22 2013 -0500
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (C) 2013 x265 project
+ *
+ * Authors: Steve Borho <steve at borho.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
+ *
+ * This program is also available under a commercial proprietary license.
+ * For more information, contact us at licensing at multicorewareinc.com.
+ *****************************************************************************/
+
+#include "x265.h"
+#include "common.h"
+
+#define XSTR(x) STR(x)
+#define STR(x) #x
+
+#if defined(__clang__)
+#define NVM_COMPILEDBY "[clang " XSTR(__clang_major__) "." XSTR(__clang_minor__) "." XSTR(__clang_patchlevel__) "]"
+#ifdef __IA64__
+#define NVM_ONARCH "[on 64-bit] "
+#else
+#define NVM_ONARCH "[on 32-bit] "
+#endif
+#endif
+
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
+#define NVM_COMPILEDBY "[GCC " XSTR(__GNUC__) "." XSTR(__GNUC_MINOR__) "." XSTR(__GNUC_PATCHLEVEL__) "]"
+#ifdef __IA64__
+#define NVM_ONARCH "[on 64-bit] "
+#else
+#define NVM_ONARCH "[on 32-bit] "
+#endif
+#endif
+
+#ifdef __INTEL_COMPILER
+#define NVM_COMPILEDBY "[ICC " XSTR(__INTEL_COMPILER) "]"
+#elif _MSC_VER
+#define NVM_COMPILEDBY "[MSVC " XSTR(_MSC_VER) "]"
+#endif
+
+#ifndef NVM_COMPILEDBY
+#define NVM_COMPILEDBY "[Unk-CXX]"
+#endif
+
+#ifdef _WIN32
+#define NVM_ONOS "[Windows]"
+#elif __linux
+#define NVM_ONOS "[Linux]"
+#elif __CYGWIN__
+#define NVM_ONOS "[Cygwin]"
+#elif __APPLE__
+#define NVM_ONOS "[Mac OS X]"
+#else
+#define NVM_ONOS "[Unk-OS]"
+#endif
+
+#if X86_64
+#define NVM_BITS "[64 bit] "
+#else
+#define NVM_BITS "[32 bit] "
+#endif
+
+#if HIGH_BIT_DEPTH
+#define BITDEPTH "16bpp"
+const int x265_max_bit_depth = 8; // 12;
+#else
+#define BITDEPTH "8bpp"
+const int x265_max_bit_depth = 8;
+#endif
+
+const char *x265_version_str = XSTR(X265_VERSION);
+const char *x265_build_info_str = NVM_ONOS NVM_COMPILEDBY NVM_BITS BITDEPTH;
More information about the x265-commits
mailing list