mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-18 06:00:30 -04:00
* Fix for the issue that resulted in race condition between target creating and populating databases and the one copying created databases to required directories. The issue was caused by lack of dependency between those targets, what allowed CMake engine to parallelize them. As a result, databases were copied before their creation has been finished, what resulted in weird discrepancies in databases content and occasional rsync errors. * Removed unused multicomp_install function. * Refactored DB tests readContent helper.
42 lines
1.4 KiB
CMake
42 lines
1.4 KiB
CMake
macro(print_var VARIABLE)
|
|
if(${VARIABLE})
|
|
message(STATUS "${Green}${VARIABLE}: '${Orange}${${VARIABLE}}${ColourReset}'")
|
|
else()
|
|
message(STATUS "${Orange}No such variable: '${Red}${VARIABLE}${ColourReset}'")
|
|
endif()
|
|
endmacro()
|
|
|
|
function(strip_executable TARGET)
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
set(STRIP_PARAMS "-S")
|
|
else()
|
|
set(STRIP_PARAMS --strip-debug --strip-unneeded)
|
|
endif ()
|
|
|
|
if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
|
add_custom_command(TARGET ${TARGET} POST_BUILD
|
|
COMMAND ${CMAKE_STRIP} ${STRIP_PARAMS} $<TARGET_FILE:${TARGET}>
|
|
COMMENT "Striping ${TARGET}"
|
|
)
|
|
endif()
|
|
|
|
if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
|
|
add_custom_command(TARGET ${TARGET} POST_BUILD
|
|
COMMAND ${CMAKE_OBJCOPY} --only-keep-debug
|
|
$<TARGET_FILE:${TARGET}>
|
|
$<TARGET_FILE:${TARGET}>.debug
|
|
COMMAND ${CMAKE_STRIP} ${STRIP_PARAMS} $<TARGET_FILE:${TARGET}>
|
|
COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=$<TARGET_FILE:${TARGET}>.debug
|
|
$<TARGET_FILE:${TARGET}>
|
|
COMMENT "Striping ${TARGET}"
|
|
)
|
|
endif()
|
|
endfunction()
|
|
|
|
function(add_subdirectory_if_exists)
|
|
set(_DIR ${ARGV0})
|
|
if(IS_DIRECTORY ${_DIR})
|
|
add_subdirectory(${_DIR})
|
|
endif()
|
|
endfunction()
|