On Fri, Sep 20, 2024 at 11:30 AM Jun Omae <jun6...@gmail.com> wrote:
>
> Hi,
>
> On 2024/09/16 21:41, rin...@apache.org wrote:
> > Author: rinrab
> > Date: Mon Sep 16 12:41:13 2024
> > New Revision: 1920717
> >
> > URL: http://svn.apache.org/viewvc?rev=1920717&view=rev
> > Log:
> > Merge the `cmake` branch to trunk.
>
> I encounter the following error on all of cmdline.* tests with Visual Studio
> as cmake generator.
>
> [[[
[...]
> ]]]
>
> The exception is raised when launching <build-dir>/svnadmin.exe because the
> file is actually located in <build-dir>/Release/svnadmin.exe. It is not raised
> when cmake with Ninja is used because <build-dir>/svnadmin.exe is located.
>
> I think we could use $<TARGET_FILE_DIR:target> instead of
> ${CMAKE_CURRENT_BINARY_DIR} as a workaround.
>
> [[[
> Index: CMakeLists.txt
> ===================================================================
> --- CMakeLists.txt      (revision 1920797)
> +++ CMakeLists.txt      (working copy)
> @@ -671,13 +671,13 @@
>            "cmdline.${py_test_name}"
>          COMMAND
>            "${Python3_EXECUTABLE}" 
> "${CMAKE_CURRENT_SOURCE_DIR}/build/run_tests.py"
> -          --bin ${CMAKE_CURRENT_BINARY_DIR}
> -          --tools-bin ${CMAKE_CURRENT_BINARY_DIR}
> +          --bin $<TARGET_FILE_DIR:svnadmin>
> +          --tools-bin $<TARGET_FILE_DIR:entries-dump>
>            --verbose
>            --log-to-stdout
>            --set-log-level=WARNING
>            ${CMAKE_CURRENT_SOURCE_DIR}
> -          ${CMAKE_CURRENT_BINARY_DIR}
> +          $<TARGET_FILE_DIR:svnadmin>
>            ${py_test_path}
>        )
>      endif()
> ]]]

Oh, I didn't notice this problem, because I am using a single config
generator. I think the suggested code is great for resolving the
issue, because I think there is no generator expression to get the
target dir in the current config without a specific target. However, I
think it's better to use svn's target dir since it's the main
executable and maybe the same for tools (?). It actually should be the
same for all targets, so it doesn't meter.

Also, I think we should add some multi-config generator tests to the
GitHub Actions workflow, to prevent similar problems in future.

-- 
Timofei Zhakov

Reply via email to