1
votes

I have a MonoTouch project where I want to include a reference to some native ios libraries that are only used for testing & debugging. I do not need these refereces to be compiled into the release build.

I've tried editing the .csproj file to have a Condition for the ItemGroup that links in the Native References, but they seem to be ignored.

 <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<NativeReference Include="some path">
  <IsCxx>false</IsCxx>
  <Kind>Static</Kind>
</NativeReference>

I suppose there could be some way using the Additional mtouch arguments option in the project Options window. I am unsure though.

Does anyone know how I can link a native reference for a specific build configuration only in MonoDevelop?

1

1 Answers

3
votes

MonoDevelop let you provide different Addtional mtouch arguments for every configuration it defines for your project. In general it means each of the four: [Debug|Release]|iPhone[Simulator] could use different settings.

If you're manually adding a static library then it's easy to add (or remove) it from a specific target.

However if you're using bindings made with the new [LinkWith] support then those additional arguments are automagically made for you. There could be ways to hack around this (e.g. changing the Build Action) but I did not try them out.