mirror of https://github.com/AxioDL/metaforce.git
CMake: Add Linux presets with Address Sanitizer
This commit is contained in:
parent
937aeda51f
commit
3a71a72ec7
|
@ -231,7 +231,12 @@ else()
|
|||
add_compile_options(-fno-asynchronous-unwind-tables)
|
||||
endif()
|
||||
|
||||
if(METAFORCE_MSAN)
|
||||
if (METAFORCE_ASAN)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++> -fsanitize=address
|
||||
-fsanitize-address-use-after-scope)
|
||||
add_link_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++> -fsanitize=address
|
||||
-fsanitize-address-use-after-scope)
|
||||
elseif(METAFORCE_MSAN)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++> -fsanitize=memory
|
||||
-fsanitize-memory-track-origins -fsanitize-recover=all)
|
||||
endif()
|
||||
|
@ -250,10 +255,6 @@ else()
|
|||
if(APPLE)
|
||||
add_compile_options(-Wno-error=deprecated-declarations
|
||||
$<$<CONFIG:Release>:-flto=thin>)
|
||||
if (METAFORCE_ASAN)
|
||||
add_compile_options(-fsanitize=address -fsanitize-address-use-after-scope)
|
||||
add_link_options(-fsanitize=address -fsanitize-address-use-after-scope)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
|
|
@ -85,6 +85,32 @@
|
|||
"linux-clang"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "linux-clang-debug-asan",
|
||||
"displayName": "Linux (Clang) Debug w/ ASAN",
|
||||
"inherits": [
|
||||
"linux-clang-debug"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"METAFORCE_ASAN": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-clang-relwithdebinfo-asan",
|
||||
"displayName": "Linux (Clang) RelWithDebInfo w/ ASAN",
|
||||
"inherits": [
|
||||
"linux-clang-relwithdebinfo"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"METAFORCE_ASAN": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc",
|
||||
"displayName": "Windows (MSVC)",
|
||||
|
@ -295,6 +321,18 @@
|
|||
"description": "Linux (Clang) release build with debug info",
|
||||
"displayName": "Linux (Clang) RelWithDebInfo"
|
||||
},
|
||||
{
|
||||
"name": "linux-clang-debug-asan",
|
||||
"configurePreset": "linux-clang-debug-asan",
|
||||
"description": "Linux (Clang) debug build w/ ASAN",
|
||||
"displayName": "Linux (Clang) Debug w/ ASAN"
|
||||
},
|
||||
{
|
||||
"name": "linux-clang-relwithdebinfo-asan",
|
||||
"configurePreset": "linux-clang-relwithdebinfo-asan",
|
||||
"description": "Linux (Clang) release build with debug info w/ ASAN",
|
||||
"displayName": "Linux (Clang) RelWithDebInfo w/ ASAN"
|
||||
},
|
||||
{
|
||||
"name": "macos-default-debug",
|
||||
"configurePreset": "macos-default-debug",
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit f27a63f312ba15b986e186b993d9d201d63a118b
|
||||
Subproject commit 01970c7249cfa30487da40b29e98ad3a5e51ae76
|
|
@ -136,9 +136,13 @@ Icon GetIcon() {
|
|||
int iconHeight = 0;
|
||||
auto* data = stbi_load_from_memory(static_cast<const stbi_uc*>(METAFORCE_ICON), int(METAFORCE_ICON_SZ), &iconWidth,
|
||||
&iconHeight, nullptr, 4);
|
||||
size_t size = static_cast<size_t>(iconWidth) * static_cast<size_t>(iconHeight) * 4;
|
||||
auto ptr = std::make_unique<u8[]>(size);
|
||||
memcpy(ptr.get(), data, size);
|
||||
stbi_image_free(data);
|
||||
return Icon{
|
||||
std::unique_ptr<uint8_t[]>{data},
|
||||
static_cast<size_t>(iconWidth) * static_cast<size_t>(iconHeight) * 4,
|
||||
std::move(ptr),
|
||||
size,
|
||||
static_cast<uint32_t>(iconWidth),
|
||||
static_cast<uint32_t>(iconHeight),
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue