mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-29 11:25:27 -04:00
Move cmake scripts/modules to separate directory, adding Products will add new more scripts so first clean up, then changes.
21 lines
1.1 KiB
CMake
21 lines
1.1 KiB
CMake
option (THIRD_PARTY_DEBUG_OPTIMIZE "Optimize third party in debug" ON)
|
|
|
|
# optimize third party sources in debug by setting source file properties
|
|
macro (third_party_source_optimization)
|
|
if (${THIRD_PARTY_DEBUG_OPTIMIZE} AND (${CMAKE_BUILD_TYPE} STREQUAL "Debug") AND NOT (${PROJECT_TARGET} STREQUAL "TARGET_Linux"))
|
|
set_property(SOURCE ${ARGV} APPEND_STRING PROPERTY COMPILE_FLAGS " -Os")
|
|
endif ()
|
|
endmacro ()
|
|
|
|
# setup flags for a third party target
|
|
macro (third_party_target_setup TARGET_NAME)
|
|
target_compile_definitions(${TARGET_NAME} PUBLIC ${PROJECT_CONFIG_DEFINITIONS})
|
|
target_compile_definitions(${TARGET_NAME} PUBLIC ${PROJECT_TARGET})
|
|
target_compile_definitions(${TARGET_NAME} PUBLIC ${TARGET_COMPILE_DEFINITIONS})
|
|
target_include_directories(${TARGET_NAME} PUBLIC ${BOARD_DIR_INCLUDES} )
|
|
target_include_directories(${TARGET_NAME} PUBLIC ${PROJECT_INCLUDES})
|
|
target_compile_features(${TARGET_NAME} PUBLIC ${TARGET_COMPILE_FEATURES})
|
|
target_compile_options(${TARGET_NAME} PUBLIC ${TARGET_COMPILE_OPTIONS})
|
|
target_link_options(${TARGET_NAME} PUBLIC ${TARGET_LINK_OPTIONS})
|
|
endmacro ()
|