[vlc-devel] [PATCH] contrib: Set _CMAKE_TOOLCHAIN_PREFIX

Martin Storsjö martin at martin.st
Mon Apr 1 23:13:48 CEST 2013

This is required for detecting ar and ranlib properly, required
e.g. when cross compiling for android from OS X.

One can't set CMAKE_AR or CMAKE_RANLIB directly. Normally they
should be set properly automatically within cmake, but those
codepaths seem to be skipped when we set the C/CXX compilers

Would it make sense to do this for all cases, not only for
android? (The condition basically is "whenever $(HOST) is set
 contrib/src/main.mak |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 3222f6d..3eef365 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -392,6 +392,9 @@ ifdef HAVE_DARWIN_OS
 	echo "set(CMAKE_CXX_FLAGS $(CFLAGS))" >> $@
 	echo "set(CMAKE_LD_FLAGS $(LDFLAGS))" >> $@
+	echo "set(_CMAKE_TOOLCHAIN_PREFIX $(HOST)-)" >> $@
 	echo "set(CMAKE_C_COMPILER $(CC))" >> $@
 	echo "set(CMAKE_CXX_COMPILER $(CXX))" >> $@
 	echo "set(CMAKE_FIND_ROOT_PATH $(PREFIX))" >> $@

More information about the vlc-devel mailing list