System.Data.SQLite
Check-in [d404fc5314]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enable use of the interop assembly under Mono on Unix.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d404fc5314ee0d4ec62b5db18329acecada8429f
User & Date: mistachkin 2016-03-22 22:59:33
Context
2016-03-22
23:26
More compilation fixes for non-Windows platforms. check-in: f168458919 user: mistachkin tags: trunk
22:59
Enable use of the interop assembly under Mono on Unix. check-in: d404fc5314 user: mistachkin tags: trunk
22:33
More test constraint and portability fixes. check-in: b4365a972b user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Setup/build_mono.bat.

    30     30   
    31     31   %_VECHO% Tools = '%TOOLS%'
    32     32   
    33     33   SET BUILD_CONFIGURATIONS=DebugManagedOnly ReleaseManagedOnly
    34     34   SET PLATFORMS="Any CPU"
    35     35   SET YEARS=2008 2013
    36     36   SET NOUSER=1
    37         -SET MSBUILD_ARGS=/property:UseInteropDll=false
    38         -SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:UseSqliteStandard=true
           37  +SET MSBUILD_ARGS=/property:UseSqliteStandardLibraryName=true
    39     38   SET MSBUILD_ARGS=%MSBUILD_ARGS% /property:InteropCodec=false
    40     39   
    41     40   CALL :fn_ResetErrorLevel
    42     41   
    43     42   %__ECHO3% CALL "%TOOLS%\build_all.bat"
    44     43   
    45     44   IF ERRORLEVEL 1 (

Changes to System.Data.SQLite/SQLiteDefineConstants.cs.

   135    135   #if RETARGETABLE
   136    136               "RETARGETABLE",
   137    137   #endif
   138    138   
   139    139   #if SQLITE_STANDARD
   140    140               "SQLITE_STANDARD",
   141    141   #endif
          142  +
          143  +#if SQLITE_STANDARD_LIBRARY_NAME
          144  +            "SQLITE_STANDARD_LIBRARY_NAME",
          145  +#endif
   142    146   
   143    147   #if THROW_ON_DISPOSED
   144    148               "THROW_ON_DISPOSED",
   145    149   #endif
   146    150   
   147    151   #if TRACE
   148    152               "TRACE",

Changes to System.Data.SQLite/Targets/System.Data.SQLite.Properties.targets.

   148    148         NOTE: For interaction with the native SQLite implementation, use the
   149    149               standard DLL (i.e. "sqlite3.dll")?
   150    150     -->
   151    151     <PropertyGroup Condition="'$(UseSqliteStandard)' != 'false'">
   152    152       <DefineConstants>$(DefineConstants);SQLITE_STANDARD</DefineConstants>
   153    153     </PropertyGroup>
   154    154   
          155  +  <!--
          156  +      NOTE: For interaction with the native SQLite implementation, use the
          157  +            standard DLL file name (i.e. "sqlite3.dll") even when compiled
          158  +            to use the interop DLL?
          159  +  -->
          160  +  <PropertyGroup Condition="'$(UseSqliteStandardLibraryName)' != 'false'">
          161  +    <DefineConstants>$(DefineConstants);SQLITE_STANDARD_LIBRARY_NAME</DefineConstants>
          162  +  </PropertyGroup>
          163  +
   155    164     <!--
   156    165         NOTE: Is the project being built to support the .NET Compact Framework?
   157    166     -->
   158    167     <PropertyGroup Condition="'$(IsCompactFramework)' != 'false'">
   159    168       <DefineConstants>$(DefineConstants);PLATFORM_COMPACTFRAMEWORK</DefineConstants>
   160    169     </PropertyGroup>
   161    170   

Changes to System.Data.SQLite/UnsafeNativeMethods.cs.

  1350   1350       //
  1351   1351       // NOTE: On the .NET Compact Framework, the native interop assembly must
  1352   1352       //       be used because it provides several workarounds to .NET Compact
  1353   1353       //       Framework limitations important for proper operation of the core
  1354   1354       //       System.Data.SQLite functionality (e.g. being able to bind
  1355   1355       //       parameters and handle column values of types Int64 and Double).
  1356   1356       //
         1357  +#if SQLITE_STANDARD_LIBRARY_NAME
         1358  +    internal const string SQLITE_DLL = "sqlite3";
         1359  +#else
  1357   1360       internal const string SQLITE_DLL = "SQLite.Interop.100.dll";
         1361  +#endif
  1358   1362   #elif SQLITE_STANDARD
  1359   1363       //
  1360   1364       // NOTE: Otherwise, if the standard SQLite library is enabled, use it.
  1361   1365       //
  1362   1366       internal const string SQLITE_DLL = "sqlite3";
  1363   1367   #elif USE_INTEROP_DLL
  1364   1368         //
  1365   1369       // NOTE: Otherwise, if the native SQLite interop assembly is enabled,
  1366   1370       //       use it.
  1367   1371       //
         1372  +#if SQLITE_STANDARD_LIBRARY_NAME
         1373  +    internal const string SQLITE_DLL = "sqlite3";
         1374  +#else
  1368   1375       internal const string SQLITE_DLL = "SQLite.Interop.dll";
         1376  +#endif
  1369   1377   #else
  1370   1378       //
  1371   1379       // NOTE: Finally, assume that the mixed-mode assembly is being used.
  1372   1380       //
  1373   1381       internal const string SQLITE_DLL = "System.Data.SQLite.dll";
  1374   1382   #endif
  1375   1383   

Changes to Targets/SQLite.NET.Settings.targets.

   338    338                 standard DLL (i.e. "sqlite3.dll")?  By default, this is disabled.
   339    339                 This property is mutually exclusive with the "UseInteropDll" one,
   340    340                 above.  This should always be disabled in the project file that
   341    341                 builds the NetModule target.
   342    342       -->
   343    343       <UseSqliteStandard Condition="'$(UseSqliteStandard)' == ''">false</UseSqliteStandard>
   344    344   
          345  +    <!--
          346  +        NOTE: For interaction with the native SQLite implementation, use the
          347  +              standard DLL file name (i.e. "sqlite3.dll") even when compiled
          348  +              to use the interop DLL??  By default, this is disabled.  This
          349  +              should always be disabled in the project file that builds the
          350  +              NetModule target.
          351  +    -->
          352  +    <UseSqliteStandardLibraryName Condition="'$(UseSqliteStandardLibraryName)' == ''">false</UseSqliteStandardLibraryName>
          353  +
   345    354       <!--
   346    355           NOTE: Is the project being built to support the .NET Compact Framework?
   347    356       -->
   348    357       <IsCompactFramework Condition="'$(IsCompactFramework)' == ''">false</IsCompactFramework>
   349    358   
   350    359       <!--
   351    360           NOTE: Emit an AssemblyFlags attribute that includes the Retargetable

Changes to lib/System.Data.SQLite/common.eagle.

  3870   3870               INTEROP_INCLUDE_CEROD INTEROP_INCLUDE_EXTRA INTEROP_INCLUDE_SEE \
  3871   3871               INTEROP_INCLUDE_ZIPVFS INTEROP_JSON1_EXTENSION \
  3872   3872               INTEROP_LEGACY_CLOSE INTEROP_LOG INTEROP_PERCENTILE_EXTENSION \
  3873   3873               INTEROP_REGEXP_EXTENSION INTEROP_TEST_EXTENSION \
  3874   3874               INTEROP_TOTYPE_EXTENSION INTEROP_VIRTUAL_TABLE NET_20 NET_35 \
  3875   3875               NET_40 NET_45 NET_451 NET_452 NET_46 NET_461 NET_COMPACT_20 \
  3876   3876               PLATFORM_COMPACTFRAMEWORK PRELOAD_NATIVE_LIBRARY RETARGETABLE \
  3877         -            SQLITE_STANDARD THROW_ON_DISPOSED TRACE TRACE_CONNECTION \
  3878         -            TRACE_DETECTION TRACE_HANDLE TRACE_PRELOAD TRACE_SHARED \
  3879         -            TRACE_STATEMENT TRACE_WARNING TRACK_MEMORY_BYTES \
         3877  +            SQLITE_STANDARD SQLITE_STANDARD_LIBRARY_NAME THROW_ON_DISPOSED \
         3878  +            TRACE TRACE_CONNECTION TRACE_DETECTION TRACE_HANDLE TRACE_PRELOAD \
         3879  +            TRACE_SHARED TRACE_STATEMENT TRACE_WARNING TRACK_MEMORY_BYTES \
  3880   3880               USE_ENTITY_FRAMEWORK_6 USE_INTEROP_DLL USE_PREPARE_V2 WINDOWS] {
  3881   3881             #
  3882   3882             # NOTE: Check if the compile-time option is listed in the list of
  3883   3883             #       "define constants" kept track of by the managed assembly.
  3884   3884             #
  3885   3885             checkForSQLiteDefineConstant $::test_channel $defineConstant
  3886   3886           }