From 9a41def39c2e108a425c2f57264f372f2c1134c4 Mon Sep 17 00:00:00 2001 From: Adam Szmigin Date: Tue, 29 Sep 2020 22:47:19 +0100 Subject: Set `__cplusplus` correctly on MSVC under CMake --- CMakeLists.txt | 6 +++++- meson.build | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac70adf..06f992e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,11 +6,15 @@ # The meson/ninja build should be preferred in all other cases. # cmake_minimum_required(VERSION 3.13) -project(libdjinterop VERSION 0.14.0) +project(libdjinterop VERSION 0.14.1) # Require C++17 set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) +if (MSVC) + # Ask MSVC to populate the __cplusplus macro properly. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus") +endif() # Option to use either system SQLite or embedded SQLite. option(SYSTEM_SQLITE "Use system installation of SQLite" ON) diff --git a/meson.build b/meson.build index 6017948..ea2e18d 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'djinterop', 'cpp', 'c', - version: '0.14.0', + version: '0.14.1', license: 'LGPL-3.0', default_options: ['cpp_std=c++17', 'default_library=both']) -- cgit v1.2.3