Restructure of mono.sln and build properties to better fix static/dynamic library...
[mono.git] / msvc / mono.props
index 23f0ec49c4655646527a7753ec7930e516244356..42c56e0f1787542014442512cf61730bdbf90eac 100644 (file)
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup Label="MonoDefines">
-    <top_srcdir>$(MSBuildProjectDirectory)\..</top_srcdir>
-    <LIBGC_CPPFLAGS_INCLUDE>$(top_srcdir)\libgc\include</LIBGC_CPPFLAGS_INCLUDE>
-    <GLIB_CFLAGS_INCLUDE>$(top_srcdir)\eglib\src</GLIB_CFLAGS_INCLUDE>
-    <BOEHM_DEFINES>HAVE_BOEHM_GC</BOEHM_DEFINES>
+  <PropertyGroup Label="UserMacros">
+    <!-- Change this to custom build tree location to enable out of source tree builds, example c:/mono-build/ -->
+    <MONO_BUILD_DIR_PREFIX>$(MSBuildProjectDirectory)/./build/</MONO_BUILD_DIR_PREFIX>
+    <!-- Change this to custom distribution tree location to enable out of source tree distribution, example c:/mono-dist/ -->
+    <MONO_INSTALL_DIR_PREFIX>$(MSBuildProjectDirectory)/./dist/</MONO_INSTALL_DIR_PREFIX>
+    <!-- GC in use, sgen or boehm, default is sgen. -->
+    <MONO_TARGET_GC>sgen</MONO_TARGET_GC>
+    <!-- When true, build targets will get a suffix based on used GC. Makes it possible to have builds using different GC's in same build folders, sharing common targets. -->
+    <MONO_USE_TARGET_SUFFIX>true</MONO_USE_TARGET_SUFFIX>
+    <!-- When true, build will get a separate build folder based on used GC. Makes it possible separate builds into different output folders under the same build prefix. -->
+    <MONO_USE_SEPARATE_BUILD_DIR>true</MONO_USE_SEPARATE_BUILD_DIR>
+    <!-- When true, all binaries and libraries will link using static c-runtime. When false, all binaries and libraries will link using dynamic c-runtime.  -->
+    <MONO_USE_STATIC_C_RUNTIME>false</MONO_USE_STATIC_C_RUNTIME>
+    <!-- When true, mono binaries will link using static libmono. When false, mono binaries will link using dynamic libmono.  -->
+    <MONO_USE_STATIC_LIBMONO>false</MONO_USE_STATIC_LIBMONO>
+  </PropertyGroup>
+  <PropertyGroup Label="MonoDirectories">
+    <MonoSourceLocation Condition="'$(MonoSourceLocation)' == '' ">..</MonoSourceLocation>
+    <top_srcdir>$(MSBuildProjectDirectory)/$(MonoSourceLocation)</top_srcdir>
+    <MONO_DIR>$(top_srcdir)</MONO_DIR>
+    <MONO_INCLUDE_DIR>$(MONO_DIR)/mono</MONO_INCLUDE_DIR>
+    <MONO_EGLIB_INCLUDE_DIR>$(MONO_DIR)/mono/eglib</MONO_EGLIB_INCLUDE_DIR>
+    <MONO_EGLIB_SOURCE_DIR>$(MONO_DIR)/mono/eglib</MONO_EGLIB_SOURCE_DIR>
+    <MONO_LIBGC_INCLUDE_DIR>$(MONO_DIR)/libgc/include</MONO_LIBGC_INCLUDE_DIR>
+    <MONO_LIBGC_SOURCE_DIR>$(MONO_DIR)/libgc/src</MONO_LIBGC_SOURCE_DIR>
+    <MONO_JIT_INCLUDE_DIR>$(MONO_INCLUDE_DIR)/jit</MONO_JIT_INCLUDE_DIR>
+    <MONO_JIT_SOURCE_DIR>$(MONO_INCLUDE_DIR)/jit</MONO_JIT_SOURCE_DIR>
+    <LIBGC_CPPFLAGS_INCLUDE>$(MONO_LIBGC_INCLUDE_DIR)</LIBGC_CPPFLAGS_INCLUDE>
+    <GLIB_CFLAGS_INCLUDE>$(MONO_EGLIB_SOURCE_DIR)</GLIB_CFLAGS_INCLUDE>
+  </PropertyGroup>
+  <PropertyGroup Label="Static-C-Runtime" Condition="$(MONO_USE_STATIC_C_RUNTIME)=='true'">
+    <MONO_C_RUNTIME Condition="'$(Configuration)'=='Debug'">MultiThreadedDebug</MONO_C_RUNTIME>
+    <MONO_C_RUNTIME Condition="'$(Configuration)'!='Debug'">MultiThreaded</MONO_C_RUNTIME>
+  </PropertyGroup>
+  <PropertyGroup Label="Dynamic-C-Runtime" Condition="$(MONO_USE_STATIC_C_RUNTIME)!='true'">
+    <MONO_C_RUNTIME Condition="'$(Configuration)'=='Debug'">MultiThreadedDebugDLL</MONO_C_RUNTIME>
+    <MONO_C_RUNTIME Condition="'$(Configuration)'!='Debug'">MultiThreadedDLL</MONO_C_RUNTIME>
+  </PropertyGroup>
+  <PropertyGroup Label="MonoSGEN" Condition="$(MONO_TARGET_GC)=='sgen' Or $(MONO_TARGET_GC)!='boehm'">
     <SGEN_DEFINES>HAVE_SGEN_GC;HAVE_MOVING_COLLECTOR;HAVE_WRITE_BARRIERS</SGEN_DEFINES>
+    <GC_DEFINES>$(SGEN_DEFINES)</GC_DEFINES>
+    <GC_LIB>libgcmonosgen.lib</GC_LIB>
+    <MONO_DEF>monosgen.def</MONO_DEF>
+    <MONO_TARGET_SUFFIX Condition="'$(MONO_USE_TARGET_SUFFIX)'=='true'">-sgen</MONO_TARGET_SUFFIX>
+    <MONO_BUILD_DIR_PREFIX Condition="'$(MONO_USE_SEPARATE_BUILD_DIR)'=='true'">$(MONO_BUILD_DIR_PREFIX)sgen/</MONO_BUILD_DIR_PREFIX>
+  </PropertyGroup>
+  <PropertyGroup Label="MonoBOEHM" Condition="$(MONO_TARGET_GC)=='boehm'">
+    <BOEHM_DEFINES>HAVE_BOEHM_GC</BOEHM_DEFINES>
+    <GC_DEFINES>$(BOEHM_DEFINES)</GC_DEFINES>
+    <GC_LIB>libgc.lib</GC_LIB>
+    <MONO_DEF>mono.def</MONO_DEF>
+    <MONO_TARGET_SUFFIX Condition="'$(MONO_USE_TARGET_SUFFIX)'=='true'">-boehm</MONO_TARGET_SUFFIX>
+    <MONO_BUILD_DIR_PREFIX Condition="'$(MONO_USE_SEPARATE_BUILD_DIR)'=='true'">$(MONO_BUILD_DIR_PREFIX)boehm/</MONO_BUILD_DIR_PREFIX>
+  </PropertyGroup>
+  <PropertyGroup Label="Static-Mono-Libraries">
+    <MONO_RUNTIME_LIBS>libmonoutils.lib;libmonoruntime$(MONO_TARGET_SUFFIX).lib;libmini$(MONO_TARGET_SUFFIX).lib;$(GC_LIB)</MONO_RUNTIME_LIBS>
+    <MONO_STATIC_LIBMONO_LIB>libmono-static$(MONO_TARGET_SUFFIX).lib</MONO_STATIC_LIBMONO_LIB>
+    <MONO_DYNAMIC_LIBMONO_LIB>mono-2.0$(MONO_TARGET_SUFFIX).lib</MONO_DYNAMIC_LIBMONO_LIB>
+  </PropertyGroup>
+  <PropertyGroup Label="Static-libmono-Library" Condition="$(MONO_USE_STATIC_LIBMONO)=='true'">
+    <MONO_LIBMONO_LIB>$(MONO_STATIC_LIBMONO_LIB)</MONO_LIBMONO_LIB>
+  </PropertyGroup>
+  <PropertyGroup Label="Dynamic-libmono-Library" Condition="$(MONO_USE_STATIC_LIBMONO)!='true'">
+    <MONO_LIBMONO_LIB>eglib.lib;$(MONO_DYNAMIC_LIBMONO_LIB)</MONO_LIBMONO_LIB>
+  </PropertyGroup>
+  <PropertyGroup Label="MonoProfiler">
+    <VTUNE_INCLUDE_DIR>$(ProgramFiles)/Intel/VTune Amplifier XE 2013/include</VTUNE_INCLUDE_DIR>
   </PropertyGroup>
+  <ItemGroup>
+    <BuildMacro Include="MONO_BUILD_DIR_PREFIX">
+      <Value>$(MONO_BUILD_DIR_PREFIX)</Value>
+    </BuildMacro>
+    <BuildMacro Include="MONO_INSTALL_DIR_PREFIX">
+      <Value>$(MONO_INSTALL_DIR_PREFIX)</Value>
+    </BuildMacro>
+    <BuildMacro Include="MONO_TARGET_GC">
+      <Value>$(MONO_TARGET_GC)</Value>
+    </BuildMacro>
+    <BuildMacro Include="MONO_USE_TARGET_SUFFIX">
+      <Value>$(MONO_USE_TARGET_SUFFIX)</Value>
+    </BuildMacro>
+    <BuildMacro Include="MONO_USE_SEPARATE_BUILD_DIR">
+      <Value>$(MONO_USE_SEPARATE_BUILD_DIR)</Value>
+    </BuildMacro>
+    <BuildMacro Include="MONO_USE_STATIC_C_RUNTIME">
+      <Value>$(MONO_USE_STATIC_C_RUNTIME)</Value>
+    </BuildMacro>
+    <BuildMacro Include="MONO_USE_STATIC_LIBMONO">
+      <Value>$(MONO_USE_STATIC_LIBMONO)</Value>
+    </BuildMacro>
+  </ItemGroup>
   <ItemDefinitionGroup>
     <ClCompile>
       <DllExportPreprocessorDefinitions>MONO_DLL_EXPORT</DllExportPreprocessorDefinitions>
       <DllImportPreprocessorDefinitions>MONO_DLL_IMPORT</DllImportPreprocessorDefinitions>
-      <PreprocessorDefinitions>__default_codegen__;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;GC_NOT_DLL;WIN32_THREADS;WINVER=0x0600;_WIN32_WINNT=0x0600;_WIN32_IE=0x0501;_UNICODE;UNICODE;WIN32_THREADS;FD_SETSIZE=1024;$(PreprocessorDefinitions);_WINSOCKAPI_</PreprocessorDefinitions>
-         <DisableSpecificWarnings>4273;4005</DisableSpecificWarnings>
+      <PreprocessorDefinitions>__default_codegen__;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;GC_NOT_DLL;WIN32_THREADS;WINVER=0x0600;_WIN32_WINNT=0x0600;_WIN32_IE=0x0501;_UNICODE;UNICODE;FD_SETSIZE=1024;%(PreprocessorDefinitions);</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4273;4005</DisableSpecificWarnings>
+      <RuntimeLibrary>$(MONO_C_RUNTIME)</RuntimeLibrary>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>Mswsock.lib;ws2_32.lib;ole32.lib;oleaut32.lib;psapi.lib;version.lib;advapi32.lib;winmm.lib;kernel32.lib;$(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>Mswsock.lib;ws2_32.lib;ole32.lib;oleaut32.lib;psapi.lib;version.lib;advapi32.lib;winmm.lib;kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(MONO_BUILD_DIR_PREFIX)$(Platform)/lib/$(Configuration)</AdditionalLibraryDirectories>
     </Link>
-    </ItemDefinitionGroup>
-</Project>
+    <Lib>
+      <AdditionalLibraryDirectories>$(MONO_BUILD_DIR_PREFIX)$(Platform)/lib/$(Configuration)</AdditionalLibraryDirectories>
+    </Lib>
+  </ItemDefinitionGroup>
+</Project>
\ No newline at end of file