Add C++ standard to CMake for MSVC
This commit is contained in:
parent
f07596dbb5
commit
d8b55078ba
3 changed files with 18 additions and 1 deletions
10
.vscode/settings.json
vendored
Normal file
10
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"files.associations": {
|
||||
"*.rst": "restructuredtext",
|
||||
"*.make": "makefile",
|
||||
"opam": "ocaml.opam",
|
||||
"schema.capnp.h": "c",
|
||||
"stdbool.h": "c"
|
||||
},
|
||||
"cmake.configureOnOpen": false
|
||||
}
|
||||
|
|
@ -9,6 +9,13 @@ project(c-capnproto LANGUAGES ${languages})
|
|||
|
||||
include(CTest)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_EXTENSIONS NO)
|
||||
if(BUILD_TESTING)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_EXTENSIONS NO)
|
||||
endif()
|
||||
|
||||
# Stop noise if CXX compiler is set.
|
||||
set(ignoreAndAvoidCMakeUnusedWarning "${CMAKE_CXX_COMPILER}")
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include "addressbook.capnp.h"
|
||||
|
||||
static capn_text chars_to_text(const char *chars) {
|
||||
return (capn_text) {
|
||||
return {
|
||||
.len = (int) strlen(chars),
|
||||
.str = chars,
|
||||
.seg = NULL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue