mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 15:13:34 +08:00
NuttX cmake improvements
- fix temporary Make.defs copy - implement custom macros for COMPILE, COMPILEXX, ASSEMBLE, ARCHIVE to enable ccache properly (if available and enabled) - fix NuttX mkdeps - fix libapps race condition with context
This commit is contained in:
+4
-3
@@ -35,17 +35,18 @@
|
||||
|
||||
option(CCACHE "Use ccache if available" ON)
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if (CCACHE AND CCACHE_PROGRAM AND NOT DEFINED ENV{CCACHE_DISABLE})
|
||||
|
||||
if(CCACHE AND CCACHE_PROGRAM AND NOT DEFINED ENV{CCACHE_DISABLE})
|
||||
get_filename_component(ccache_real_path ${CCACHE_PROGRAM} REALPATH)
|
||||
get_filename_component(cxx_real_path ${CMAKE_CXX_COMPILER} REALPATH)
|
||||
get_filename_component(cxx_abs_path ${CMAKE_CXX_COMPILER} ABSOLUTE)
|
||||
|
||||
if ("${ccache_real_path}" STREQUAL "${cxx_real_path}")
|
||||
message(STATUS "ccache enabled via symlink (${cxx_abs_path} -> ${cxx_real_path})")
|
||||
set(CCACHE_PROGRAM "" CACHE INTERNAL "ccache program" FORCE)
|
||||
else()
|
||||
message(STATUS "ccache enabled (export CCACHE_DISABLE=1 to disable)")
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
||||
endif()
|
||||
|
||||
else()
|
||||
set(CCACHE_PROGRAM "" CACHE INTERNAL "ccache program" FORCE)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user