Skip to content

Commit

Permalink
cmake presets (#10)
Browse files Browse the repository at this point in the history
* add CMakePresets.json

* small fix
  • Loading branch information
skallweitNV authored Sep 2, 2024
1 parent 0e9b1e1 commit caac6ad
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
67 changes: 67 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"description": "Default build using Ninja Multi-Config generator",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build"
},
{
"name": "msvc-base",
"hidden": true,
"inherits": "default",
"description": "Options specific for MSVC",
"cacheVariables": {
"CMAKE_C_FLAGS_INIT": "-D_ITERATOR_DEBUG_LEVEL=0 /MP",
"CMAKE_CXX_FLAGS_INIT": "-D_ITERATOR_DEBUG_LEVEL=0 /MP"
}
},
{
"name": "msvc",
"inherits": "msvc-base",
"description": "Ninja Multi-Config generator with MSVC",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
},
{
"name": "vs2019",
"inherits": "msvc-base",
"description": "Visual Studio 2019 project",
"generator": "Visual Studio 16 2019"
},
{
"name": "vs2022",
"inherits": "msvc-base",
"description": "Visual Studio 2022 project",
"generator": "Visual Studio 17 2022"
}
],
"buildPresets": [
{
"name": "msvc-debug",
"configurePreset": "msvc",
"configuration": "Debug"
},
{
"name": "msvc-release",
"configurePreset": "default",
"configuration": "Release"
}
]
}
2 changes: 1 addition & 1 deletion src/core/struct-holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class StructHolder
if (str)
{
char* newStr = (char*)allocate(std::strlen(str) + 1);
std::strcpy(newStr, str);
std::memcpy(newStr, str, std::strlen(str) + 1);
str = newStr;
}
}
Expand Down

0 comments on commit caac6ad

Please sign in to comment.