x264.cmake 2.18 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
############################################################################
# x264.cmake
# Copyright (C) 2014  Belledonne Communications, Grenoble France
#
############################################################################
#
# 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
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 21 22
#
############################################################################

23 24 25 26
lcb_git_repository("git://git.videolan.org/x264.git")
lcb_git_tag("adc99d17d8c1fbc164fae8319b40d7c45f30314e")
lcb_external_source_paths("externals/x264")
lcb_ignore_warnings(YES)
27

28 29
lcb_build_method("autotools")
lcb_cross_compilation_options(
30
	"--prefix=${CMAKE_INSTALL_PREFIX}"
31
	"--host=${LINPHONE_BUILDER_HOST}"
32
)
33
lcb_configure_options(
34 35
	"--extra-cflags=$CFLAGS"
	"--extra-ldflags=$LDFLAGS"
36
)
37
if(IOS)
38
	lcb_configure_options("--sysroot=${CMAKE_OSX_SYSROOT}")
39
	string(REGEX MATCH "^(arm*|aarch64)" ARM_ARCH "${CMAKE_SYSTEM_PROCESSOR}")
40
	if(ARM_ARCH AND NOT ${XCODE_VERSION} VERSION_LESS 7)
41
		lcb_configure_options("--extra-asflags=-fembed-bitcode")
42
	endif()
43
elseif(ANDROID)
44
	lcb_configure_options("--sysroot=${CMAKE_SYSROOT}")
45
	if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
46
		set(X264_HOST "arm-none-linux-gnueabi")
47
	else()
48
		set(X264_HOST "i686-linux-gnueabi")
49
	endif()
50 51 52 53 54
	lcb_cross_compilation_options(
		"--prefix=${CMAKE_INSTALL_PREFIX}"
		"--host=${X264_HOST}"
	)
	lcb_use_c_compiler_for_assembler(YES)
55
endif()
56 57

lcb_linking_type("--enable-shared")
58
if(IOS)
59
	lcb_configure_env("CC=\"$CC -arch ${LINPHONE_BUILDER_OSX_ARCHITECTURES}\"")
60
else()
61
	lcb_configure_env("CC=$CC")
62
endif()
63
lcb_install_target("install-lib-shared")