Skip to content

Modernize cmake scripts and support MSVC 2017 #834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: 0.13-release
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Build: Add cmake option CPP-NETLIB_WINAPI_VERSION
This option allows us to setup _WIN32_WINNT definition value
from cmake command line
Default value is 0x0501 (_WIN32_WINNT_WINXP)
https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt
  • Loading branch information
btolfa committed Apr 3, 2018
commit 48bbadb6448bfe0be895f3a0cdd9e07b1fcb80ea
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ option( CPP-NETLIB_ENABLE_HTTPS "Build cpp-netlib with support for https if Open
option( CPP-NETLIB_STATIC_OPENSSL "Build cpp-netlib using static OpenSSL" OFF)
option( CPP-NETLIB_STATIC_BOOST "Build cpp-netlib using static Boost" OFF)

if (NOT DEFINED CPP-NETLIB_WINAPI_VERSION)
set(CPP-NETLIB_WINAPI_VERSION 0x0501)
endif()

include(GNUInstallDirs)

# determine install path for CMake config files
Expand Down Expand Up @@ -116,7 +120,7 @@ endif()


if (WIN32)
target_compile_definitions(cppnetlib INTERFACE _WIN32_WINNT=0x0501)
target_compile_definitions(cppnetlib INTERFACE _WIN32_WINNT=${CPP-NETLIB_WINAPI_VERSION} BOOST_USE_WINAPI_VERSION=${CPP-NETLIB_WINAPI_VERSION})

if (MSVC)
target_compile_options(cppnetlib INTERFACE /bigobj)
Expand Down