mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 01:06:00 +08:00
[cpp] Fix block allocator compression, closes #2792
This commit is contained in:
parent
b491d8ba4d
commit
72381a534a
@ -77,7 +77,10 @@ namespace spine {
|
||||
}
|
||||
|
||||
void compress() {
|
||||
if (blocks.size() == 1) return;
|
||||
if (blocks.size() == 1) {
|
||||
blocks[0].allocated = 0;
|
||||
return;
|
||||
}
|
||||
int totalSize = 0;
|
||||
for (int i = 0, n = (int)blocks.size(); i < n; i++) {
|
||||
totalSize += blocks[i].size;
|
||||
|
||||
@ -57,3 +57,27 @@ add_custom_command(TARGET spine-sdl-c-example PRE_BUILD
|
||||
add_custom_command(TARGET spine-sdl-cpp-example PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_LIST_DIR}/data $<TARGET_FILE_DIR:spine-sdl-cpp-example>/data)
|
||||
|
||||
if(APPLE)
|
||||
# Create the entitlements file in build directory
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/debug.entitlements
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
|
||||
<plist version=\"1.0\">
|
||||
<dict>
|
||||
<key>com.apple.security.get-task-allow</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>")
|
||||
|
||||
# Sign the executables
|
||||
add_custom_command(TARGET spine-sdl-cpp-example POST_BUILD
|
||||
COMMAND codesign --force --sign - --entitlements ${CMAKE_BINARY_DIR}/debug.entitlements $<TARGET_FILE:spine-sdl-cpp-example>
|
||||
COMMENT "Signing target with entitlements for Instruments"
|
||||
)
|
||||
|
||||
add_custom_command(TARGET spine-sdl-c-example POST_BUILD
|
||||
COMMAND codesign --force --sign - --entitlements ${CMAKE_BINARY_DIR}/debug.entitlements $<TARGET_FILE:spine-sdl-c-example>
|
||||
COMMENT "Signing target with entitlements for Instruments"
|
||||
)
|
||||
endif()
|
||||
Loading…
x
Reference in New Issue
Block a user