Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix native components build for Android #32800

Merged
merged 6 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ include(${CMAKE_CURRENT_LIST_DIR}/functions.cmake)
# - for windows we use the passed in parameter to CMAKE to determine build arch
#----------------------------------------
set(CLR_CMAKE_HOST_OS ${CMAKE_SYSTEM_NAME})
if(CLR_CMAKE_HOST_OS STREQUAL Linux)
if(CLR_CMAKE_HOST_OS STREQUAL Linux OR CLR_CMAKE_HOST_OS STREQUAL Android)
set(CLR_CMAKE_HOST_UNIX 1)
if(CLR_CROSS_COMPONENTS_BUILD)
if(CLR_CROSS_COMPONENTS_BUILD AND NOT CLR_CMAKE_HOST_OS STREQUAL Android)
# CMAKE_HOST_SYSTEM_PROCESSOR returns the value of `uname -p` on host.
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL amd64)
if(CLR_CMAKE_TARGET_ARCH STREQUAL "arm" OR CLR_CMAKE_TARGET_ARCH STREQUAL "armel")
Expand All @@ -36,7 +36,7 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l)
set(CLR_CMAKE_HOST_UNIX_ARM 1)
set(CLR_CMAKE_HOST_UNIX_ARMV7L 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm OR CMAKE_SYSTEM_PROCESSOR STREQUAL armv7-a)
set(CLR_CMAKE_HOST_UNIX_ARM 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
set(CLR_CMAKE_HOST_UNIX_ARM64 1)
Expand All @@ -54,10 +54,12 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux)
set(LINUX_ID_FILE "${CMAKE_SYSROOT}${LINUX_ID_FILE}")
endif()

execute_process(
COMMAND bash -c "source ${LINUX_ID_FILE} && echo \$ID"
OUTPUT_VARIABLE CLR_CMAKE_LINUX_ID
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(EXISTS ${LINUX_ID_FILE})
execute_process(
COMMAND bash -c "source ${LINUX_ID_FILE} && echo \$ID"
OUTPUT_VARIABLE CLR_CMAKE_LINUX_ID
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

if(DEFINED CLR_CMAKE_LINUX_ID)
if(CLR_CMAKE_LINUX_ID STREQUAL tizen)
Expand All @@ -66,12 +68,14 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux)
elseif(CLR_CMAKE_LINUX_ID STREQUAL alpine)
set(CLR_CMAKE_HOST_ALPINE_LINUX 1)
set(CLR_CMAKE_HOST_OS ${CLR_CMAKE_LINUX_ID})
elseif(CLR_CMAKE_LINUX_ID STREQUAL android)
set(CLR_CMAKE_HOST_ANDROID 1)
set(CLR_CMAKE_HOST_OS ${CLR_CMAKE_LINUX_ID})
endif()
endif(DEFINED CLR_CMAKE_LINUX_ID)
endif(CLR_CMAKE_HOST_OS STREQUAL Linux)

if(CLR_CMAKE_HOST_OS STREQUAL Android)
set(CLR_CMAKE_HOST_ANDROID 1)
set(CLR_CMAKE_HOST_OS ${CLR_CMAKE_HOST_OS})
endif()
endif(CLR_CMAKE_HOST_OS STREQUAL Linux OR CLR_CMAKE_HOST_OS STREQUAL Android)

if(CLR_CMAKE_HOST_OS STREQUAL Darwin)
set(CLR_CMAKE_HOST_UNIX 1)
Expand Down Expand Up @@ -233,11 +237,11 @@ if(CLR_CMAKE_TARGET_OS STREQUAL alpine)
set(CLR_CMAKE_TARGET_ALPINE_LINUX 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL alpine)

if(CLR_CMAKE_TARGET_OS STREQUAL android)
if(CLR_CMAKE_TARGET_OS STREQUAL Android)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_LINUX 1)
set(CLR_CMAKE_TARGET_ANDROID 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL android)
endif(CLR_CMAKE_TARGET_OS STREQUAL Android)

if(CLR_CMAKE_TARGET_OS STREQUAL Darwin)
set(CLR_CMAKE_TARGET_UNIX 1)
Expand Down
8 changes: 4 additions & 4 deletions eng/native/configuretools.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
if(NOT CLR_CMAKE_CONFIGURE_PLATFORM_INCLUDED)
message(FATAL_ERROR "configuretools.cmake needs to be included after configureplatform.cmake")
endif()
include(${CMAKE_CURRENT_LIST_DIR}/configureplatform.cmake)

# Get the version of the compiler that is in the file name for tool location.
set (CLR_CMAKE_COMPILER_FILE_NAME_VERSION "")
Expand Down Expand Up @@ -52,7 +50,9 @@ if(NOT WIN32)
if(NOT CLR_CMAKE_TARGET_DARWIN AND NOT CLR_CMAKE_TARGET_IOS)
locate_toolchain_exec(objdump CMAKE_OBJDUMP)

if(CMAKE_CROSSCOMPILING AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD AND (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR
if(CMAKE_SYSTEM_NAME STREQUAL Android)
set(TOOSET_PREFIX ${ANDROID_TOOLCHAIN_PREFIX})
elseif(CMAKE_CROSSCOMPILING AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD AND (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR
CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm))
set(TOOLSET_PREFIX "${TOOLCHAIN}-")
else()
Expand Down
6 changes: 3 additions & 3 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function(clr_unknown_arch)
if (WIN32)
message(FATAL_ERROR "Only AMD64, ARM64, ARM and I386 are supported")
message(FATAL_ERROR "Only AMD64, ARM64, ARM and I386 are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}")
elseif(CLR_CROSS_COMPONENTS_BUILD)
message(FATAL_ERROR "Only AMD64, I386 host are supported for linux cross-architecture component")
message(FATAL_ERROR "Only AMD64, I386 host are supported for linux cross-architecture component. Found: ${CMAKE_SYSTEM_PROCESSOR}")
else()
message(FATAL_ERROR "Only AMD64, ARM64 and ARM are supported")
message(FATAL_ERROR "Only AMD64, ARM64 and ARM are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
endfunction()

Expand Down
19 changes: 17 additions & 2 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_policy(SET CMP0042 NEW)
# Set the project name
project(CoreCLR)

include(${CLR_ENG_NATIVE_DIR}/configureplatform.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)

if (CLR_CMAKE_HOST_WIN32)
message(STATUS "VS_PLATFORM_TOOLSET is ${CMAKE_VS_PLATFORM_TOOLSET}")
Expand Down Expand Up @@ -110,11 +110,14 @@ else (CLR_CMAKE_HOST_WIN32)
endif()
endif(CLR_CMAKE_HOST_WIN32)

if(CLR_CMAKE_TARGET_ANDROID)
add_definitions(-DTARGET_ANDROID)
endif()

#----------------------------------------------------
# Configure compiler settings for environment
#----------------------------------------------------
include(configurecompiler.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)

#----------------------------------------------------
# Cross target Component build specific configuration
Expand All @@ -141,6 +144,18 @@ endif(NOT CLR_CROSS_COMPONENTS_BUILD)
# - do not depend on clr's compile definitions
#-----------------------------------------
if(CLR_CMAKE_HOST_UNIX)
if(CLR_CMAKE_TARGET_ANDROID)
find_library(LZMA NAMES lzma)
if(LZMA STREQUAL LZMA-NOTFOUND)
message(FATAL_ERROR "Cannot find liblzma.")
endif(LZMA STREQUAL LZMA-NOTFOUND)

find_library(ANDROID_GLOB NAMES android-glob)
if(ANDROID_GLOB STREQUAL ANDROID_GLOB-NOTFOUND)
message(FATAL_ERROR "Cannot find android-glob.")
endif()
endif()

add_subdirectory(src/pal)
add_subdirectory(src/hosts)
endif(CLR_CMAKE_HOST_UNIX)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/clrfeatures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT DEFINED FEATURE_PERFTRACING AND FEATURE_EVENT_TRACE)
endif(NOT DEFINED FEATURE_PERFTRACING AND FEATURE_EVENT_TRACE)

if(NOT DEFINED FEATURE_DBGIPC)
if(CLR_CMAKE_TARGET_UNIX AND (NOT CLR_CMAKE_TARGET_ANDROID))
if(CLR_CMAKE_TARGET_UNIX)
set(FEATURE_DBGIPC 1)
endif()
endif(NOT DEFINED FEATURE_DBGIPC)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ endif(CLR_CMAKE_TARGET_WIN32 AND FEATURE_EVENT_TRACE)
add_subdirectory(debug/dbgutil)

if(CLR_CMAKE_HOST_UNIX)
if(CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86)
if(CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86 AND NOT CLR_CMAKE_HOST_ANDROID)
add_subdirectory(debug/createdump)
endif(CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86)
endif(CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86 AND NOT CLR_CMAKE_HOST_ANDROID)

# Include the dummy c++ include files
include_directories("pal/inc/rt/cpp")
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ else(CLR_CMAKE_HOST_WIN32)
set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
endif(CLR_CMAKE_TARGET_DARWIN)

if(CLR_CMAKE_TARGET_ANDROID AND CLR_CMAKE_HOST_ARCH_ARM)
set(EXPORTS_LINKER_OPTION "${EXPORTS_LINKER_OPTION} -Wl,--no-warn-shared-textrel")
endif()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://android-developers.googleblog.com/2016/06/android-changes-for-ndk-developers.html - NDK picked up some shared textrels during the arm (32-bit) build of libcoreclr. Looking at some of your coreclr PRs, @janvorli, I understood that coreclr intends to comply with hardened kernels (at least in 64-bit). The (warning-as) error message was:

Warning: shared library text segment is not shareable

Maybe it could be investigated, as the rootcause might not be Android specific?


endif (CLR_CMAKE_HOST_WIN32)

add_definitions(-DFX_VER_INTERNALNAME_STR=CoreCLR.dll)
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/src/gc/unix/gcenv.unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#undef min
#undef max

#include <algorithm>

#if HAVE_SYS_TIME_H
#include <sys/time.h>
#else
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/inc/eventtracebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ extern UINT32 g_nClrInstanceId;

#endif // defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))

#if defined(FEATURE_PERFTRACING)
#if defined(FEATURE_PERFTRACING) || defined(FEATURE_EVENTSOURCE_XPLAT)

/***************************************/
/* Tracing levels supported by CLR ETW */
Expand Down Expand Up @@ -397,7 +397,7 @@ class XplatEventLoggerConfiguration
NewArrayHolder<WCHAR> _argument;
bool _isValid;
};
#endif // FEATURE_PERFTRACING
#endif // defined(FEATURE_PERFTRACING) || defined(FEATURE_EVENTSOURCE_XPLAT)

#if defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))

Expand Down
29 changes: 3 additions & 26 deletions src/coreclr/src/pal/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,34 +290,11 @@ if(CLR_CMAKE_TARGET_LINUX)
pthread
rt
)
endif()

if(CLR_CMAKE_TARGET_ANDROID)
find_library(LZMA NAMES lzma)

if(LZMA STREQUAL LZMA-NOTFOUND)
message(FATAL_ERROR "Cannot find liblzma.")
endif(LZMA STREQUAL LZMA-NOTFOUND)

else(NOT CLR_CMAKE_TARGET_ANDROID)
target_link_libraries(coreclrpal
gnustl_shared
android-support
android-glob
${ANDROID_GLOB}
${LZMA})
endif()

if(CLR_MAKE_TARGET_ANDROID)
find_library(ANDROID_SUPPORT NAMES android-support)
find_library(ANDROID_GLOB NAMES android-glob)

if(ANDROID_SUPPORT STREQUAL ANDROID_SUPPORT-NOTFOUND)
message(FATAL_ERROR "Cannot find android-support.")
endif()

if(ANDROID_GLOB STREQUAL ANDROID_GLOB-NOTFOUND)
message(FATAL_ERROR "Cannot find android-glob.")
endif()
endif()
endif(NOT CLR_CMAKE_TARGET_ANDROID)

target_link_libraries(coreclrpal
dl
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/src/pal/src/safecrt/mbusafecrt_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#ifndef MBUSAFECRT_INTERNAL_H
#define MBUSAFECRT_INTERNAL_H

#define PAL_IMPLEMENTATION

#include "pal_mstypes.h"

#ifndef DLLEXPORT
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/src/pal/src/thread/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ BOOL CONTEXT_GetRegisters(DWORD processId, LPCONTEXT lpContext)
ucontext_t registers;
#if HAVE_PT_REGS
struct pt_regs ptrace_registers;
if (ptrace((__ptrace_request)PT_GETREGS, processId, (caddr_t) &ptrace_registers, 0) == -1)
if (ptrace((__ptrace_request)PTRACE_GETREGS, processId, (caddr_t) &ptrace_registers, 0) == -1)
#elif HAVE_BSD_REGS_T
struct reg ptrace_registers;
if (PAL_PTRACE(PT_GETREGS, processId, &ptrace_registers, 0) == -1)
Expand Down Expand Up @@ -352,7 +352,7 @@ CONTEXT_SetThreadContext(
(CONTEXT_CONTROL | CONTEXT_INTEGER) & CONTEXT_AREA_MASK)
{
#if HAVE_PT_REGS
if (ptrace((__ptrace_request)PT_GETREGS, dwProcessId, (caddr_t)&ptrace_registers, 0) == -1)
if (ptrace((__ptrace_request)PTRACE_GETREGS, dwProcessId, (caddr_t)&ptrace_registers, 0) == -1)
#elif HAVE_BSD_REGS_T
if (PAL_PTRACE(PT_GETREGS, dwProcessId, &ptrace_registers, 0) == -1)
#endif
Expand Down Expand Up @@ -383,7 +383,7 @@ CONTEXT_SetThreadContext(
#undef ASSIGN_REG

#if HAVE_PT_REGS
if (ptrace((__ptrace_request)PT_SETREGS, dwProcessId, (caddr_t)&ptrace_registers, 0) == -1)
if (ptrace((__ptrace_request)PTRACE_SETREGS, dwProcessId, (caddr_t)&ptrace_registers, 0) == -1)
#elif HAVE_BSD_REGS_T
if (PAL_PTRACE(PT_SETREGS, dwProcessId, &ptrace_registers, 0) == -1)
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/src/scripts/genEventing.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ def generatePlatformIndependentFiles(sClrEtwAllMan, incDir, etmDummyFile, extern
{
int const Level;
ULONGLONG const Keyword;
} EVENT_DESCRIPTOR;""")
} EVENT_DESCRIPTOR;
""")

if not is_windows:
Clrproviders.write(eventpipe_trace_context_typedef) # define EVENTPIPE_TRACE_CONTEXT
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/src/vm/ceemain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,10 +924,12 @@ void EEStartupHelper()
hr = g_pGCHeap->Initialize();
IfFailGo(hr);

#ifdef FEATURE_EVENT_TRACE
// Finish setting up rest of EventPipe - specifically enable SampleProfiler if it was requested at startup.
// SampleProfiler needs to cooperate with the GC which hasn't fully finished setting up in the first part of the
// EventPipe initialization, so this is done after the GC has been fully initialized.
EventPipe::FinishInitialize();
#endif

// This isn't done as part of InitializeGarbageCollector() above because thread
// creation requires AppDomains to have been set up.
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/src/vm/gctoclreventsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ void GCToCLREventSink::FireDynamicEvent(const char* eventName, void* payload, ui

void GCToCLREventSink::FireGCStart_V2(uint32_t count, uint32_t depth, uint32_t reason, uint32_t type)
{
#ifdef FEATURE_EVENT_TRACE
LIMITED_METHOD_CONTRACT;

ETW::GCLog::ETW_GC_INFO gcStartInfo;
Expand All @@ -33,6 +34,7 @@ void GCToCLREventSink::FireGCStart_V2(uint32_t count, uint32_t depth, uint32_t r
gcStartInfo.GCStart.Reason = static_cast<ETW::GCLog::ETW_GC_INFO::GC_REASON>(reason);
gcStartInfo.GCStart.Type = static_cast<ETW::GCLog::ETW_GC_INFO::GC_TYPE>(type);
ETW::GCLog::FireGcStart(&gcStartInfo);
#endif
}

void GCToCLREventSink::FireGCGenerationRange(uint8_t generation, void* rangeStart, uint64_t rangeUsedLength, uint64_t rangeReservedLength)
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14.2)
cmake_policy(SET CMP0042 NEW)
project(Tests)

include(${CLR_ENG_NATIVE_DIR}/configureplatform.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)

set(INC_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/Common/Platform)
if (CLR_CMAKE_TARGET_WIN32)
Expand All @@ -12,7 +12,6 @@ endif()

# Include global configure settings
include(${CMAKE_CURRENT_SOURCE_DIR}/../configurecompiler.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)
# Compile options

if (CLR_CMAKE_HOST_WIN32)
Expand Down
1 change: 0 additions & 1 deletion src/installer/corehost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.14.2)

project(corehost)

include(${CLR_ENG_NATIVE_DIR}/configureplatform.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)
include(../settings.cmake)
include(../functions.cmake)
Expand Down
2 changes: 1 addition & 1 deletion src/installer/corehost/cli/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function(set_common_libs TargetType)

# Libraries used for exe projects
if (${TargetType} STREQUAL "exe")
if(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD)
if((CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD) AND NOT CLR_CMAKE_TARGET_ANDROID)
target_link_libraries (${DOTNET_PROJECT_NAME} "pthread")
endif()

Expand Down
4 changes: 4 additions & 0 deletions src/installer/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ elseif(CLR_CMAKE_TARGET_FREEBSD)
add_compile_options(-fstack-protector)
endif()

if(CLR_CMAKE_TARGET_ANDROID)
add_compile_options(-Wno-user-defined-warnings)
endif()

add_definitions(-D_NO_ASYNCRTIMP)
add_definitions(-D_NO_PPLXIMP)
if(CLR_CMAKE_TARGET_LINUX)
Expand Down
8 changes: 6 additions & 2 deletions src/libraries/Native/Unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_policy(SET CMP0042 NEW)

project(CoreFX C)

include(${CLR_ENG_NATIVE_DIR}/configureplatform.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)

if(CLR_CMAKE_TARGET_IOS)
cmake_minimum_required(VERSION 3.14.5)
Expand Down Expand Up @@ -84,6 +84,11 @@ elseif (CLR_CMAKE_TARGET_ARCH_ARM)
endif()
endif ()

if(CLR_CMAKE_TARGET_ANDROID)
add_definitions(-DTARGET_ANDROID)
include_directories(SYSTEM "${CROSS_ROOTFS}/usr/include")
endif()

string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE)
if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG)
add_compile_options(-O0)
Expand Down Expand Up @@ -195,7 +200,6 @@ function(install_library_and_symbols targetName)
endfunction()

include(configure.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)

add_subdirectory(System.IO.Compression.Native)

Expand Down
Loading