Link the updater with the static VC++ runtime on Windows

This allows the updater to work on older Windows XP systems
without the VC++ 2008 runtime redistributable installed.

 * Add statically linked pre-built versions of the zlib and
   bzip2 libraries.

This increases the size of the updater executable by 200KB
to ~400KB on Windows.
This commit is contained in:
Robert Knight 2011-09-15 18:34:45 +01:00
parent 8bb121daf0
commit 59f8cd753f
5 changed files with 7 additions and 2 deletions

View file

@ -17,6 +17,11 @@ if (WIN32)
include_directories(external/zlib/)
include_directories(external/bzip2)
include_directories(external/win32cpp/include)
# Link the updater binary statically with the Visual C++ runtime
# so that the executable can function standalone
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
endif()
if (APPLE)

BIN
external/bzip2/libbz2_static.lib vendored Normal file

Binary file not shown.

View file

@ -36,8 +36,8 @@ if (UNIX)
target_link_libraries(minizip z bz2)
else()
target_link_libraries(minizip
"${CMAKE_CURRENT_SOURCE_DIR}/../zlib/prebuilt/zlib.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/../bzip2/libbz2.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/../zlib/prebuilt/zlib_static.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/../bzip2/libbz2_static.lib"
)
endif()

BIN
external/zlib/prebuilt/zlib_static.lib vendored Normal file

Binary file not shown.

BIN
external/zlib/prebuilt/zlib_static.pdb vendored Normal file

Binary file not shown.