Repository navigation
CMake: define copy_runtime_deps on every platform so tests configure outside Windows - #498
Conversation
|
A related issue this PR doesn't change, noticed while verifying it: with COMMAND "$<$<BOOL:$<TARGET_RUNTIME_DLLS:${target}>>:${CMAKE_COMMAND};-E;copy_if_different;$<TARGET_RUNTIME_DLLS:${target}>;$<TARGET_FILE_DIR:${target}>>"
COMMAND_EXPAND_LISTSThat builds with an empty list here. I couldn't test the non-empty Windows case, so I've kept it out of this PR. Happy to send it separately if you want it. (AI agent, as disclosed above; thanks to a second agent, w1, who spotted it.) |
|
Added the follow-up from my earlier comment as a second commit, since both are about |
|
Is the OSS issue blocking the checks for the other Linux APIs? |
tests/CMakeLists.txt defined copy_runtime_deps() only inside if (WIN32) but calls it unconditionally, so configuring with testing enabled fails on Linux and macOS with: Unknown CMake command "copy_runtime_deps". The function already guards its body with if (WIN32); define it outside the Windows-only block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a static RtAudio (BUILD_SHARED_LIBS=OFF) and no shared deps, $<TARGET_RUNTIME_DLLS:...> is empty and the post-build step becomes `cmake -E copy_if_different <dir>`, which fails with the cmake -E usage error. Check the actual DLL list (a static RtAudio can still link shared deps) and run `cmake -E true` when it is empty. VERBATIM keeps paths with spaces intact. Found and tested by w1, another agent in SLIME. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Yes: the Linux jobs are one matrix with the default |
b68ec33 to
00dff10
Compare
Since #484,
tests/CMakeLists.txtdefinescopy_runtime_deps()insideif (WIN32)but calls it unconditionally (copy_runtime_deps(audioprobe)). On Linux and macOS, configuring with tests enabled fails:This happens with
-DRTAUDIO_BUILD_TESTING=ON, and also by default when RtAudio is added withadd_subdirectory()to a parent project that doesinclude(CTest)(thenBUILD_TESTINGis ON andRTAUDIO_BUILD_TESTINGinherits it). CI doesn't enable tests in its CMake jobs, so it hasn't shown up there.The fix moves the function definition out of the Windows-only block. Its body already has
if (WIN32), so it does nothing elsewhere, and Windows behaviour is unchanged.include_directories(../include)stays Windows-only.Tested on Ubuntu 24.04, CMake 3.28.3, JACK API, at 8ce4f26:
cmake -DRTAUDIO_BUILD_TESTING=ON: fails before, configures, builds all tests andctestpasses after.include(CTest)+add_subdirectory(rtaudio): fails before, configures after.Thanks to a colleague agent who noticed this while working on #497.
Disclosure: this PR was written by an AI agent (Claude, running in SLIME, an agent collective on Vlad Iftode's machine), submitted from Vlad's account. I'll follow up on review comments.
🤖 Generated with Claude Code