Example #1
0
 public static void AddProjectDefines(
     XmlDocument project, MonoNativeFlavor flavor, MonoNativeLinkMode link,
     string platform, string config)
 {
     AddProjectDefines(project, flavor, platform, config);
     AddProjectDefines(project, link, platform, config);
 }
Example #2
0
        public static void AddProjectDefines(
            XmlDocument project, MonoNativeLinkMode link,
            string platform, string config)
        {
            switch (link)
            {
            case MonoNativeLinkMode.Static:
                project.AddAdditionalDefines("MONO_NATIVE_STATIC", platform, config);
                project.RemoveDefines("MONO_NATIVE_DYNAMIC; MONO_NATIVE_SYMLINK", platform, config);
                break;

            case MonoNativeLinkMode.Dynamic:
                project.AddAdditionalDefines("MONO_NATIVE_DYNAMIC", platform, config);
                project.RemoveDefines("MONO_NATIVE_STATIC; MONO_NATIVE_SYMLINK", platform, config);
                break;

            case MonoNativeLinkMode.Symlink:
                project.AddAdditionalDefines("MONO_NATIVE_SYMLINK", platform, config);
                project.RemoveDefines("MONO_NATIVE_MONO_NATIVE_STATIC; MONO_NATIVE_DYNAMIC", platform, config);
                break;

            default:
                throw new Exception($"Unknown MonoNativeLinkMode: {link}");
            }
        }
        public static string GetPInvokeLibraryName(MonoNativeFlavor flavor, MonoNativeLinkMode link)
        {
            switch (link)
            {
            case MonoNativeLinkMode.Static:
                return(null);

            case MonoNativeLinkMode.Dynamic:
                return(GetDynamicLibraryName(flavor));

            case MonoNativeLinkMode.Symlink:
                return("libmono-native.dylib");

            default:
                Assert.Fail($"Invalid link mode: {MonoNativeConfig.LinkMode}");
                throw new NotImplementedException();
            }
        }
Example #4
0
        public static void AddProjectDefines(XmlDocument project, MonoNativeLinkMode link)
        {
            switch (link)
            {
            case MonoNativeLinkMode.Static:
                project.AddTopLevelProperty("MonoNativeMode", "MONO_NATIVE_STATIC");
                break;

            case MonoNativeLinkMode.Dynamic:
                project.AddTopLevelProperty("MonoNativeMode", "MONO_NATIVE_DYNAMIC");
                break;

            case MonoNativeLinkMode.Symlink:
                project.AddTopLevelProperty("MonoNativeMode", "MONO_NATIVE_SYMLINK");
                break;

            default:
                throw new Exception($"Unknown MonoNativeLinkMode: {link}");
            }
        }