Commit 4dc5d696 authored by Martin Storsjö's avatar Martin Storsjö

contrib: Set _CMAKE_TOOLCHAIN_PREFIX

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
manually.
Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 023049e3
......@@ -391,6 +391,9 @@ ifdef HAVE_DARWIN_OS
echo "set(CMAKE_C_FLAGS $(CFLAGS))" >> $@
echo "set(CMAKE_CXX_FLAGS $(CFLAGS))" >> $@
echo "set(CMAKE_LD_FLAGS $(LDFLAGS))" >> $@
endif
ifdef HAVE_CROSS_COMPILE
echo "set(_CMAKE_TOOLCHAIN_PREFIX $(HOST)-)" >> $@
endif
echo "set(CMAKE_C_COMPILER $(CC))" >> $@
echo "set(CMAKE_CXX_COMPILER $(CXX))" >> $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment