On Mon, Dec 9, 2024 at 4:52 PM Joel Winarske via lists.yoctoproject.org
<joel.winarske=gmail....@lists.yoctoproject.org> wrote:

> Building on scarthgap I'm seeing a problem using meson.
>
> meson snippet:
> ```
> lvgl_opt_var = cmake.subproject_options()
> lvgl_c_flags = '-DEGL_NO_X11 -DLV_CONF_PATH=' + meson.current_source_dir()
> + '/lv_conf.h'
> lvgl_cxx_flags = '-DEGL_NO_X11 -DLV_CONF_PATH=' +
> meson.current_source_dir() + '/lv_conf.h'
> lvgl_opt_var.add_cmake_defines(
>     {
>         'CMAKE_VERBOSE_MAKEFILE' : true,
>         'CMAKE_C_FLAGS' : lvgl_c_flags,
>         'CMAKE_CXX_FLAGS' : lvgl_cxx_flags })
> ```
>
> Build Error:
> ```
> | In file included from ../git/subprojects/lvgl/src/core/lv_group.h:16,
> |                  from
> ../git/subprojects/lvgl/src/core/lv_group_private.h:17,
> |                  from ../git/subprojects/lvgl/src/core/lv_group.c:9:
> | ../git/subprojects/lvgl/src/core/../lv_conf_internal.h:54:42: fatal
> error:
> /mnt/raid10/yocto/scarthgap/up2u/tmp/work/corei7-64-poky-1/libdrmpp/git/git/examples/lvgl/lv_conf.h:
> No such file or directory
> |    54 |         #include __LV_TO_STR(LV_CONF_PATH)
> |       |                                          ^
> | compilation terminated.
> ```
>
> Observations:
> ```
> $ ls -la
> /mnt/raid10/yocto/scarthgap/up2u/tmp/work/corei7-64-poky-1/libdrmpp/git/git/examples/lvgl/lv_conf.h
> ls: cannot access
> '/mnt/raid10/yocto/scarthgap/up2u/tmp/work/corei7-64-poky-1/libdrmpp/git/git/examples/lvgl/lv_conf.h':
> No such file or directory
> ```
>
> ```
> $ ls -la
> /mnt/raid10/yocto/scarthgap/up2u/tmp/work/corei7-64-poky-linux/libdrmpp/git/git/examples/lvgl/lv_conf.h
>
> -rw-r--r--. 1 joel joel 36431 Dec  9 16:39
> /mnt/raid10/yocto/scarthgap/up2u/tmp/work/corei7-64-poky-linux/libdrmpp/git/git/examples/lvgl/lv_conf.h
> ```
>
> The same meson snippet works correctly on desktop
>


I don't think this is a meson problem. If you build the same package on
your desktop system, and happen to have your sources under a path that has
'/linux/' or '/somethingsomething-linux/' in one of the directory names,
you'll probably see the same thing.

There's probably a '#define linux 1' somewhere (either predefined or in a
prior header file), and the preprocessor, when converting a token to a
string, is making that substitution for you.

I ran into this myself, recently, with another package.

-Matt


>
> Why does `meson.current_source_dir()` in Yocto build return an incorrect
> path?
>
> Thanks,
> Joel
>
> 
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64424): https://lists.yoctoproject.org/g/yocto/message/64424
Mute This Topic: https://lists.yoctoproject.org/mt/110017878/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to