mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-07 00:21:48 +02:00
Update MaxmindDB to current git.
This commit is contained in:
53
vendor/MaxmindDB/CMakeLists.txt
vendored
53
vendor/MaxmindDB/CMakeLists.txt
vendored
@@ -1,12 +1,18 @@
|
||||
cmake_minimum_required (VERSION 3.7)
|
||||
cmake_minimum_required (VERSION 3.9)
|
||||
|
||||
project(maxminddb
|
||||
LANGUAGES C
|
||||
VERSION 1.5.0
|
||||
VERSION 1.6.0
|
||||
)
|
||||
set(MAXMINDDB_SOVERSION 0.0.7)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
|
||||
if (WIN32)
|
||||
option(MSVC_STATIC_RUNTIME "When ON the library will be built by using MT/MTd run-time libraries" OFF)
|
||||
endif()
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)
|
||||
option(BUILD_TESTING "Build test programs" OFF)
|
||||
option(BUILD_TESTING "Build test programs" ON)
|
||||
|
||||
include(CheckTypeSize)
|
||||
check_type_size("unsigned __int128" UINT128)
|
||||
@@ -30,7 +36,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
endif()
|
||||
|
||||
configure_file(${PROJECT_SOURCE_DIR}/include/maxminddb_config.h.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/maxminddb_config.h)
|
||||
${PROJECT_SOURCE_DIR}/include/maxminddb_config.h)
|
||||
|
||||
add_library(maxminddb
|
||||
src/maxminddb.c
|
||||
@@ -52,13 +58,27 @@ endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(maxminddb ws2_32)
|
||||
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()
|
||||
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX lib)
|
||||
set(CMAKE_STATIC_LIBRARY_PREFIX lib)
|
||||
|
||||
target_include_directories(maxminddb PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||
target_include_directories(maxminddb PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
target_include_directories(maxminddb PUBLIC
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
set(MAXMINDB_HEADERS
|
||||
include/maxminddb.h
|
||||
@@ -66,17 +86,14 @@ set(MAXMINDB_HEADERS
|
||||
)
|
||||
set_target_properties(maxminddb PROPERTIES PUBLIC_HEADER "${MAXMINDB_HEADERS}")
|
||||
|
||||
#install(TARGETS maxminddb
|
||||
# EXPORT maxminddb
|
||||
# ARCHIVE DESTINATION lib
|
||||
# PUBLIC_HEADER DESTINATION include/
|
||||
#)
|
||||
install(TARGETS maxminddb
|
||||
EXPORT maxminddb)
|
||||
|
||||
# This is required to work with FetchContent
|
||||
#install(EXPORT maxminddb
|
||||
# FILE maxminddb-config.cmake
|
||||
# NAMESPACE maxminddb::
|
||||
# DESTINATION lib/cmake/maxminddb)
|
||||
install(EXPORT maxminddb
|
||||
FILE maxminddb-config.cmake
|
||||
NAMESPACE maxminddb::
|
||||
DESTINATION lib/cmake/maxminddb)
|
||||
|
||||
# We always want to build mmdblookup
|
||||
add_subdirectory(bin)
|
||||
|
Reference in New Issue
Block a user