From b6af738eabf08b7e450e8a73290c2baca8635334 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 14 Oct 2020 22:59:15 -0400 Subject: [PATCH] Fix the android cmake build. (#43421) --- src/mono/CMakeLists.txt | 5 ++--- src/mono/mono.proj | 2 +- src/mono/mono/mini/CMakeLists.txt | 6 ++++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index fac14490536d8..26f97141dc8d8 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -247,11 +247,9 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") set(ENABLE_MONODROID 1) set(DISABLE_EXECUTABLES 1) set(GC_SUSPEND "hybrid") - add_definitions(-DNO_GLOBALIZATION_SHIM) # Force some defines set(HAVE_SCHED_GETAFFINITY 0) set(HAVE_SCHED_SETAFFINITY 0) - set(MONO_DL_NEED_USCORE 1) # FIXME: Rest of the flags from configure.ac elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") set(HOST_WASM 1) @@ -417,7 +415,8 @@ elseif(TARGET_WASM) elseif(TARGET_IOS) # FIXME: elseif(TARGET_ANDROID) - # FIXME: + set(ICU_FLAGS "-DPALEXPORT=\"\" -DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS -DHAVE_SET_MAX_VARIABLE -DTARGET_UNIX -DTARGET_ANDROID -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option") + set(HAVE_SYS_ICU 1) elseif(HOST_LINUX) pkg_check_modules(ICU icu-uc) set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations") diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 165861a01f795..a7100aeee22a1 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -6,7 +6,7 @@ --> - true + true $(ROOTFS_DIR) false .cmd diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index b18866f6ba3ee..f28e77a4d1a6d 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -51,7 +51,9 @@ set(icu_shim_sources_base addprefix(icu_shim_sources "${ICU_SHIM_PATH}" "${icu_shim_sources_base}") set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_DEFINITIONS OSX_ICU_LIBRARY_PATH="${OSX_ICU_LIBRARY_PATH}") set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_FLAGS "-I${ICU_INCLUDEDIR} -I${CMAKE_SOURCE_DIR}/../libraries/Native/Unix/System.Globalization.Native/ -I${CMAKE_SOURCE_DIR}/../libraries/Native/Unix/Common/ ${ICU_FLAGS}") -set(ICU_LDFLAGS "-L${ICU_LIBDIR}") +if(ICU_LIBDIR) + set(ICU_LDFLAGS "-L${ICU_LIBDIR}") +endif() endif() # @@ -282,7 +284,7 @@ set(OS_LIBS "-framework CoreFoundation" "-framework Foundation") elseif(HOST_IOS) set(OS_LIBS "-framework CoreFoundation" "-lobjc" "-lc++") elseif(HOST_ANDROID) -set(OS_LIBS m dl) +set(OS_LIBS m dl log) elseif(HOST_LINUX) set(OS_LIBS pthread m dl) endif()