1*4882a593SmuzhiyunThere is code to remove the prefix CMAKE_SOURCE_DIR from __FILENAME__ paths 2*4882a593Smuzhiyunused for logging with LOGE() in the code. We need to make this match the value we use 3*4882a593Smuzhiyunin the debug source remapping from CFLAGS 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunWe export the right path to use in the recipe with: 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunEXTRA_OECMAKE = "-DCMAKE_DEBUG_SRCDIR=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/" 8*4882a593Smuzhiyun 9*4882a593Smuzhiyunand we then patch this into the code instead of the broken use 10*4882a593Smuzhiyunof CMAKE_SOURCE_DIR since __FILENAME__ will match our path prefix 11*4882a593Smuzhiyunchanges. 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunThis also breaks reproducibility since the path length of the build directory 14*4882a593Smuzhiyunwill currently change the output! 15*4882a593Smuzhiyun 16*4882a593SmuzhiyunUpstream-Status: Pending [needs to be discussed upstream] 17*4882a593SmuzhiyunSigned-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunIndex: git/bldsys/cmake/global_options.cmake 20*4882a593Smuzhiyun=================================================================== 21*4882a593Smuzhiyun--- git.orig/bldsys/cmake/global_options.cmake 22*4882a593Smuzhiyun+++ git/bldsys/cmake/global_options.cmake 23*4882a593Smuzhiyun@@ -47,7 +47,7 @@ set(CMAKE_CXX_STANDARD 14) 24*4882a593Smuzhiyun set(CMAKE_DISABLE_SOURCE_CHANGES ON) 25*4882a593Smuzhiyun set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun-string(LENGTH "${CMAKE_SOURCE_DIR}/" ROOT_PATH_SIZE) 28*4882a593Smuzhiyun+string(LENGTH "${CMAKE_DEBUG_SRCDIR}/" ROOT_PATH_SIZE) 29*4882a593Smuzhiyun add_definitions(-DROOT_PATH_SIZE=${ROOT_PATH_SIZE}) 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun set(CMAKE_C_FLAGS_DEBUG "-DDEBUG=0 ${CMAKE_C_FLAGS_DEBUG}") 32