diff --git a/CMakeLists.txt b/CMakeLists.txt index 094522f7f..d10cda229 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ enable_language(ASM-ATT) option(FRAMEWORK_COREAUDIO "Enable audio-related functionality" OFF) option(FRAMEWORK_APPKIT "Enable AppKit development code" OFF) +option(BUILD_ANDROID "Target Android platforms" OFF) add_subdirectory(src) @@ -78,6 +79,8 @@ InstallSymlink(/Volumes/SystemRoot/lib64 ${CMAKE_INSTALL_PREFIX}/libexec/darling InstallSymlink(/Volumes/SystemRoot/usr/share/zoneinfo ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/zoneinfo) -# Our udev rules, so /dev/mach has 0666 permissions -install(DIRECTORY etc/udev DESTINATION /etc) +if(NOT BUILD_ANDROID) + # Our udev rules, so /dev/mach has 0666 permissions + install(DIRECTORY etc/udev DESTINATION /etc) +endif(NOT BUILD_ANDROID) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 877b8982e..ea78dfef5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -86,7 +86,10 @@ add_subdirectory(kernel) add_subdirectory(libc) add_definitions(-D_LIBC_NO_FEATURE_VERIFICATION) -add_subdirectory(external/darling-dmg) +if(NOT BUILD_ANDROID) + # Android is lack of libfuse + add_subdirectory(external/darling-dmg) +endif(NOT BUILD_ANDROID) add_subdirectory(libm) add_subdirectory(libmacho) add_subdirectory(libgcc) diff --git a/src/startup/CMakeLists.txt b/src/startup/CMakeLists.txt index 13b0dce5e..51963dcf9 100644 --- a/src/startup/CMakeLists.txt +++ b/src/startup/CMakeLists.txt @@ -9,6 +9,11 @@ endif(COMMAND cmake_policy) enable_language(C ASM) +if(BUILD_ANDROID) + list(APPEND CMAKE_MODULE_PATH "$ENV{ANDROID_NDK}/build/cmake") + include(android.toolchain) +endif(BUILD_ANDROID) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Ttext-segment,0x400000 -Wl,-Tbss,0x410000 -Wl,-Tdata,0x420000")