Skip to content

Commit

Permalink
[mono-runtimes] Add and use $(HostCc), $(HostCxx)
Browse files Browse the repository at this point in the history
`clang` isn't the C compiler everywhere, and `clang++` isn't the
C++ everywhere. For example, Ubuntu provides `clang-3.5`.

Allow the host-native C and C++ compilers to be specified/overridden
via the new $(HostCc) and $(HostCxx) MSBuild properties.
  • Loading branch information
jonpryor committed Apr 22, 2016
1 parent 1ecd075 commit 0d7bc89
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Configuration.Override.props.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<!-- The Xamarin.Android $(TargetFrameworkVersion) value that corresponds to $(AndroidApiLevel) -->
<AndroidFrameworkVersion>v6.0</AndroidFrameworkVersion>

<!-- C and C++ compilers to emit host-native binaries -->
<HostCc>clang</HostCc>
<HostCxx>clang++</HostCxx>

<!-- These must be FULL PATHS -->
<AndroidToolchainCacheDirectory>$(HOME)\android-archives</AndroidToolchainCacheDirectory>
<AndroidToolchainDirectory>$(HOME)\android-toolchain</AndroidToolchainDirectory>
Expand Down
2 changes: 2 additions & 0 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<HostOS Condition=" '$(HostOS)' == '' And '$(OS)' == 'Windows_NT' ">Windows</HostOS>
<HostOS Condition=" '$(HostOS)' == '' And '$(OS)' == 'Unix' And Exists ('/Applications') ">Darwin</HostOS>
<HostOS Condition=" '$(HostOS)' == '' And '$(OS)' == 'Unix' ">Linux</HostOS>
<HostCc Condition=" '$(HostCc)' == '' ">clang</HostCc>
<HostCxx Condition=" '$(HostCc)' == '' ">clang++</HostCxx>
<ManagedRuntime Condition=" '$(ManagedRuntime)' == '' And '$(OS)' != 'Windows_NT' ">mono</ManagedRuntime>
<HOME Condition=" '$(HOME)' == '' ">$(HOMEDRIVE)$(HOMEPATH)</HOME>
<AndroidApiLevel Condition=" '$(AndroidApiLevel)' == '' ">23</AndroidApiLevel>
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Overridable MSBuild properties include:
* `$(AndroidToolchainDirectory)`: The directory to install the downloaded
Android NDK and SDK files. This value defaults to
`$(HOME)\android-toolchain`.
* `$(HostCc)`, `$(HostCxx)`: The C and C++ compilers to use to generate
host-native binaries.

# Build Requirements

Expand Down
4 changes: 2 additions & 2 deletions build-tools/mono-runtimes/mono-runtimes.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
<_MonoRuntime Include="host">
<Ar>ar</Ar>
<As>as</As>
<Cc>clang</Cc>
<Cc>$(HostCc)</Cc>
<CFlags>$(_CommonCFlags) -mmacosx-version-min=10.9</CFlags>
<Cxx>clang++</Cxx>
<Cxx>$(HostCxx)</Cxx>
<CxxCpp>cpp</CxxCpp>
<CxxFlags></CxxFlags>
<Ld>ld</Ld>
Expand Down

0 comments on commit 0d7bc89

Please sign in to comment.