Skip to content

Commit

Permalink
Merge pull request #270 from maxmind/greg/269-changelog
Browse files Browse the repository at this point in the history
Add Changes entry for #269
  • Loading branch information
horgh authored Jul 6, 2021
2 parents 1b9284a + ee3efb5 commit fca0cba
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
20 changes: 11 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
cmake_minimum_required (VERSION 3.9)

if (WIN32 AND MSVC_STATIC_RUNTIME)
# On MSVC, when MSVC_STATIC_RUNTIME is ON, MT (Release) and MTd (Debug) run-time libraries will be used instead of MD/MDd.
# The default is OFF so MD/MDd are used when nothing related is passed.
set(CMAKE_USER_MAKE_RULES_OVERRIDE
${CMAKE_CURRENT_SOURCE_DIR}/c_flag_overrides.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX
${CMAKE_CURRENT_SOURCE_DIR}/cxx_flag_overrides.cmake)
endif()

project(maxminddb
LANGUAGES C
VERSION 1.6.0
Expand Down Expand Up @@ -70,6 +61,17 @@ if(WIN32)
if(BUILD_SHARED_LIBS)
set_target_properties(maxminddb PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
if(MSVC_STATIC_RUNTIME)
# On MSVC, when MSVC_STATIC_RUNTIME is ON, MT (Release) and MTd (Debug)
# run-time libraries will be used instead of MD/MDd. The default is OFF so
# MD/MDd are used when nothing related is passed.
#
# Adapted from https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#make-override-files
set(CMAKE_USER_MAKE_RULES_OVERRIDE
${CMAKE_CURRENT_SOURCE_DIR}/c_flag_overrides.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX
${CMAKE_CURRENT_SOURCE_DIR}/cxx_flag_overrides.cmake)
endif()
endif()

target_include_directories(maxminddb PUBLIC
Expand Down
6 changes: 6 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.6.1

* When building with Visual Studio, you may now build a static runtime with
CMake by setting `MSVC_STATIC_RUNTIME` to `ON`. Pull request by Rafael
Santiago. GitHub #269.

## 1.6.0 - 2021-04-29

* This release includes several improvements to the CMake build. In
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ You can clone this repository and build it by running:
$ git clone --recursive https://github.com/maxmind/libmaxminddb

After cloning, run `./bootstrap` from the `libmaxminddb` directory and then
follow the instructions for installing from a named release tarball as described above.
follow the instructions for installing from a named release tarball as
described above.

## Using CMake

Expand All @@ -80,10 +81,10 @@ work.
$ ctest -V .
$ cmake --build . --target install

On Windows, when using ``MSVC`` if the multithreaded (MT/MTd) run-time library is desired
instead of the shared default (MD/MDd). Try the following during build scripts generation:
When building with Visual Studio, you may build a multithreaded (MT/MTd)
runtime library, using the `MSVC_STATIC_RUNTIME` setting:

$ cmake -DMSVC_STATIC_RUNTIME=ON -DBUILD_SHARED_LIBS=OFF ..
$ cmake -DMSVC_STATIC_RUNTIME=ON -DBUILD_SHARED_LIBS=OFF ..

## On Ubuntu via PPA

Expand Down

0 comments on commit fca0cba

Please sign in to comment.