Skip to content

Commit

Permalink
Fix the android cmake build. (#43421)
Browse files Browse the repository at this point in the history
  • Loading branch information
vargaz authored Oct 15, 2020
1 parent b7998b2 commit b6af738
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-->

<PropertyGroup>
<MonoEnableCMake Condition="'$(TargetsBrowser)' == 'true' or '$(TargetsOSX)' == 'true'">true</MonoEnableCMake>
<MonoEnableCMake Condition="'$(TargetsBrowser)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetsAndroid)' == 'true'">true</MonoEnableCMake>
<MonoCrossDir Condition="'$(MonoCrossDir)' == '' and '$(ROOTFS_DIR)' != ''">$(ROOTFS_DIR)</MonoCrossDir>
<MonoEnableInterpreter Condition="'$(MonoEnableInterpreter)' == ''">false</MonoEnableInterpreter>
<ScriptExt Condition="'$(OS)' == 'Windows_NT'">.cmd</ScriptExt>
Expand Down
6 changes: 4 additions & 2 deletions src/mono/mono/mini/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

#
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit b6af738

Please sign in to comment.