Skip to content

Commit

Permalink
Statically link C runtime in release mode
Browse files Browse the repository at this point in the history
When building in release mode, make it more likely that we'll be able to
run on most Windows machines by not requiring the C runtime to be
present on the user's machine.

Also restructured the SOCI directory layout for easier upgrading in the
future.
  • Loading branch information
bartecargo committed Nov 13, 2018
1 parent 7b80562 commit a9b7cd8
Show file tree
Hide file tree
Showing 384 changed files with 291 additions and 324 deletions.
41 changes: 1 addition & 40 deletions ThirdParty/soci/.gitignore
Original file line number Diff line number Diff line change
@@ -1,40 +1 @@
# General
*.swp
*.kate-swp
tags
tmp

# Files generated by CMake
Makefile
src/core/soci_backends_config.h
tests/odbc/test-access.dsn
tests/odbc/test-mysql.dsn

# ... and the rest of CMake spam
CMakeFiles/
CMakeCache.txt
CTestTestfile.cmake
cmake_install.cmake

# Visual Studio / Visual Studio Code
*.opensdf
*.sdf
*.suo
/*.vs*

# KDevelop
*.kate-swp
*.kdev4

# Qt Creator
*.config
*.creator*
*.files
*.includes
CMakeLists.txt.user

# Eclipse
/.project

# Vagrant
/.vagrant/
/build/
14 changes: 12 additions & 2 deletions ThirdParty/soci/Build.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
$ErrorActionPreference = 'Stop'

function SetReleaseModeToStaticLinkRuntimeLibrary([string][parameter(mandatory)]$Path) {
$projectPath = (Resolve-Path -LiteralPath $Path).ProviderPath
Write-Host "$path -> $projectPath"
[xml]$project = cat -LiteralPath $projectPath
($project.Project.ItemDefinitionGroup | ? Condition -eq "'`$(Configuration)|`$(Platform)'=='Release|x64'" ).ClCompile.RuntimeLibrary = 'MultiThreaded'
$project.Save($projectPath)
}

pushd $PSScriptRoot
try {
if(test-path build) { rm -r -fo build }
md build | cd
cmake -G "Visual Studio 15 Win64" -DWITH_BOOST=OFF -DWITH_ORACLE=OFF -DWITH_ODBC=ON -DWITH_MYSQL=OFF -DWITH_POSTGRESQL=OFF -DWITH_FIREBIRD=OFF -DWITH_DB2=OFF -DSOCI_CXX_C11=ON -DSOCI_STATIC=ON -DSOCI_SHARED=OFF -DSOCI_TESTS=OFF ..
cmake -G "Visual Studio 15 Win64" -DWITH_BOOST=OFF -DWITH_ORACLE=OFF -DWITH_ODBC=ON -DWITH_MYSQL=OFF -DWITH_POSTGRESQL=OFF -DWITH_FIREBIRD=OFF -DWITH_DB2=OFF -DSOCI_CXX_C11=ON -DSOCI_STATIC=ON -DSOCI_SHARED=OFF -DSOCI_TESTS=OFF ../src
SetReleaseModeToStaticLinkRuntimeLibrary src/core/soci_core_static.vcxproj
SetReleaseModeToStaticLinkRuntimeLibrary src/backends/odbc/soci_odbc_static.vcxproj
cmake --build . --config Debug
cmake --build . --config Release
}
finally {
popd
}
}
207 changes: 0 additions & 207 deletions ThirdParty/soci/CMakeLists.txt

This file was deleted.

49 changes: 0 additions & 49 deletions ThirdParty/soci/build/include/soci/soci-config.h

This file was deleted.

Binary file modified ThirdParty/soci/build/lib/Debug/libsoci_core_4_0.lib
Binary file not shown.
Binary file modified ThirdParty/soci/build/lib/Debug/libsoci_empty_4_0.lib
Binary file not shown.
Binary file modified ThirdParty/soci/build/lib/Debug/libsoci_odbc_4_0.lib
Binary file not shown.
Binary file modified ThirdParty/soci/build/lib/Release/libsoci_core_4_0.lib
Binary file not shown.
Binary file modified ThirdParty/soci/build/lib/Release/libsoci_empty_4_0.lib
Binary file not shown.
Binary file modified ThirdParty/soci/build/lib/Release/libsoci_odbc_4_0.lib
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
60 changes: 42 additions & 18 deletions ThirdParty/soci/src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
*~
*.kdev[0-9]
# General
*.swp
aclocal.m4
autom4te.cache
confdefs.h
config.guess
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
m4
missing
Makefile
Makefile.in
*.kate-swp
tags
tmp

# Build directories
/*build*
/*site*

# Files generated by CMake
Makefile
src/core/soci_backends_config.h
tests/odbc/test-access.dsn
tests/odbc/test-mysql.dsn

# ... and the rest of CMake spam
CMakeFiles/
CMakeCache.txt
CTestTestfile.cmake
cmake_install.cmake

# Visual Studio / Visual Studio Code
*.opensdf
*.sdf
*.suo
/*.vs*

# KDevelop
*.kate-swp
*.kdev4

# Qt Creator
*.config
*.creator*
*.files
*.includes
CMakeLists.txt.user

# Eclipse
/.project

# Vagrant
/.vagrant/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit a9b7cd8

Please sign in to comment.