mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[c][cpp] Use CMake presets and Ninja as the default generator
This commit is contained in:
parent
557465ed01
commit
84a541b098
@ -34,8 +34,6 @@ target_include_directories(spine-c PUBLIC
|
|||||||
../spine-cpp/spine-cpp/include
|
../spine-cpp/spine-cpp/include
|
||||||
)
|
)
|
||||||
|
|
||||||
# Export compile commands for better IDE support
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
||||||
|
|
||||||
# Create test executable only if this is the top-level project
|
# Create test executable only if this is the top-level project
|
||||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
|
|||||||
35
spine-c/CMakePresets.json
Normal file
35
spine-c/CMakePresets.json
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "debug",
|
||||||
|
"displayName": "Debug Config",
|
||||||
|
"description": "Debug build using Ninja generator",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
|
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "release",
|
||||||
|
"inherits": "debug",
|
||||||
|
"displayName": "Release Config",
|
||||||
|
"description": "Release build using Ninja generator",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buildPresets": [
|
||||||
|
{
|
||||||
|
"name": "debug",
|
||||||
|
"configurePreset": "debug"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "release",
|
||||||
|
"configurePreset": "release"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -15,6 +15,5 @@ if [ "$1" = "clean" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Always build
|
# Always build
|
||||||
mkdir -p build && cd build
|
cmake --preset=debug .
|
||||||
[ -f CMakeCache.txt ] || cmake .. -DCMAKE_BUILD_TYPE=Debug
|
cmake --build --preset=debug
|
||||||
make -j$(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4)
|
|
||||||
35
spine-cpp/CMakePresets.json
Normal file
35
spine-cpp/CMakePresets.json
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "debug",
|
||||||
|
"displayName": "Debug Config",
|
||||||
|
"description": "Debug build using Ninja generator",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
|
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "release",
|
||||||
|
"inherits": "debug",
|
||||||
|
"displayName": "Release Config",
|
||||||
|
"description": "Release build using Ninja generator",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buildPresets": [
|
||||||
|
{
|
||||||
|
"name": "debug",
|
||||||
|
"configurePreset": "debug"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "release",
|
||||||
|
"configurePreset": "release"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -9,6 +9,5 @@ if [ "$1" = "clean" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Always build
|
# Always build
|
||||||
mkdir -p build && cd build
|
cmake --preset=debug .
|
||||||
[ -f CMakeCache.txt ] || cmake .. -DCMAKE_BUILD_TYPE=Debug
|
cmake --build --preset=debug
|
||||||
make -j$(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4)
|
|
||||||
Loading…
x
Reference in New Issue
Block a user