Skip to content

Instantly share code, notes, and snippets.

View YarikTH's full-sized avatar
🤖
you're absolutely right! I made a mistake

Yaroslav YarikTH

🤖
you're absolutely right! I made a mistake
View GitHub Profile
@YarikTH
YarikTH / gist:5ecb69db541eb38977a971d61712d0e5
Last active May 14, 2019 06:45
cmake: Separate debug symbols on gcc
# https://git.magicalgirl.moe/STJr/SRB2/commit/e08bd452279dbeedbf876fec465ea51a137455a8
## strip debug symbols into separate file when using gcc
if(CMAKE_COMPILER_IS_GNUCC)
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
message(STATUS "Will make separate debug symbols in *.debug")
add_custom_command(TARGET ${SRB2_SDL2_EXE_NAME} POST_BUILD
COMMAND ${OBJCOPY} --only-keep-debug $<TARGET_FILE:${SRB2_SDL2_EXE_NAME}> $<TARGET_FILE:${SRB2_SDL2_EXE_NAME}>.debug
COMMAND ${OBJCOPY} --strip-debug $<TARGET_FILE:${SRB2_SDL2_EXE_NAME}>
COMMAND ${OBJCOPY} --add-gnu-debuglink=$<TARGET_FILE_NAME:${SRB2_SDL2_EXE_NAME}>.debug $<TARGET_FILE:${SRB2_SDL2_EXE_NAME}>
@YarikTH
YarikTH / gist:3535d4ebd8b31c84405d09d8d78ed1e7
Created January 24, 2019 12:12
Show all cmake variables with PREFIX
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
if("${_variableName}" MATCHES "^PREFIX_*")
message(STATUS "${_variableName}=${${_variableName}}")
endif()
endforeach()