summaryrefslogtreecommitdiff
path: root/data/cmake/make.sh
diff options
context:
space:
mode:
authorMCApollo <34170230+MCApollo@users.noreply.github.com>2019-04-13 06:36:34 +0000
committerSam Bingner <sam@bingner.com>2019-05-08 14:16:13 -1000
commit0bbd60daa93c408aafcfb84c769528c9c4edfed3 (patch)
tree50824a79ba1332ca26c9ba2000a9cb9c8b565567 /data/cmake/make.sh
parentca02b0697f2f05de3bdd6c2f7cce928c9937bbc6 (diff)
Added cmake.
Diffstat (limited to 'data/cmake/make.sh')
-rw-r--r--data/cmake/make.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/data/cmake/make.sh b/data/cmake/make.sh
new file mode 100644
index 000000000..263be1933
--- /dev/null
+++ b/data/cmake/make.sh
@@ -0,0 +1,27 @@
+pkg:setup
+
+mkdir build && cd build
+cat >iphoneos_toolchain.cmake <<EOF
+set(CMAKE_BUILD_TYPE Release)
+set(CMAKE_SYSTEM_NAME Darwin) # Tell CMake we're cross-compiling
+set(CMAKE_CROSSCOMPILING true)
+#include(CMakeForceCompiler)
+# Prefix detection only works with compiler id "GNU"
+# CMake will look for prefixed g++, cpp, ld, etc. automatically
+set(CMAKE_SYSTEM_PROCESSOR aarch64)
+set(triple ${PKG_TARG})
+set(CMAKE_FIND_ROOT_PATH $(echo ${PKG_PATH} | sed -e s/:/' '/g))
+set(CMAKE_LIBRARY_PATH $(echo ${LIBRARY_PATH} | sed -e s/:/' '/g))
+set(CMAKE_INCLUDE_PATH $(echo ${INCLUDE_PATH} | sed -e s/:/' '/g))
+set(CMAKE_C_COMPILER ${PKG_TARG}-gcc)
+set(CMAKE_CXX_COMPILER ${PKG_TARG}-g++)
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG ")
+set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ")
+EOF
+
+cmake -j4 -DCMAKE_BUILD_TYPE=Release -DCMAKE_Fortran_COMPILER:FILEPATH=FALSE -DCMAKE_TOOLCHAIN_FILE=iphoneos_toolchain.cmake -DCMAKE_LOCALSTATEDIR="/private/var" -DCMAKE_INSTALL_NAME_DIR="/usr/lib" -DCMAKE_INSTALL_RPATH="/usr/" -DCMAKE_OSX_SYSROOT="${PKG_ROOT}" -DCMAKE_INSTALL_PREFIX="/usr/" -DKWSYS_LFS_WORKS=FALSE ..
+make -j4
+pkg:install