Restructure bin/: deployables at root, tests and tools in subfolders
Only the shipping artifacts (coop_host.exe, coop_hook.dll, coop_hook_x86.dll, coop_inject_x86.exe, steam_api64.dll, steam_input_actions.vdf) now land in the bin/<config>/ root, so it can be copied wholesale into a donor game folder. Test exes (plus the coop_tone fixture) build into bin/<config>/tests/ and the dev probes into bin/<config>/tools/, via a new coop_output_subdir() CMake helper. The probes resolve coop_hook.dll / the x86 injector from the deployable root one level up (new common/coop/tool_paths.hpp: deployed_artifact_path checks next-to-exe then parent). coop_tone is co-located with the tests so audio_loopback_test's "spawn coop_tone.exe next to me" lookup is unchanged. Verified from a clean bin/: root holds only deployables; ctest x64 7/7 and x86 3/3 green (incl. audio_loopback_test driving coop_tone from tests/). Also convert the roadmap Planned list to bullets and drop this (now-done) item. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,17 @@ set(COOP_OUTPUT_DIR "${CMAKE_SOURCE_DIR}/bin/$<CONFIG>")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${COOP_OUTPUT_DIR}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${COOP_OUTPUT_DIR}")
|
||||
|
||||
# Only the deployable artifacts (host, hook DLLs, injector helper, Steam files) live
|
||||
# in the bin/<config>/ root, so it can be copied wholesale into a donor game folder.
|
||||
# Tests and dev tools are staged into subfolders via this helper instead.
|
||||
# Usage: coop_output_subdir(<subdir> target1 [target2 ...]).
|
||||
function(coop_output_subdir subdir)
|
||||
foreach(tgt IN LISTS ARGN)
|
||||
set_target_properties(${tgt} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${COOP_OUTPUT_DIR}/${subdir}")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/W4 /permissive- /Zc:__cplusplus /utf-8 /MP)
|
||||
add_compile_definitions(UNICODE _UNICODE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
@@ -86,6 +97,10 @@ if(COOP_X86_HELPER_BUILD)
|
||||
target_compile_definitions(audio_hook_test_x86 PRIVATE NTDDI_VERSION=0x0A00000B)
|
||||
target_link_libraries(audio_hook_test_x86 PRIVATE coop_common safetyhook::safetyhook ole32 mmdevapi)
|
||||
add_test(NAME audio_hook_test_x86 COMMAND audio_hook_test_x86)
|
||||
|
||||
# x86 test exes go in tests/; the x86 hook DLL + injector helper stay in the
|
||||
# deployable root (set via CMAKE_RUNTIME_OUTPUT_DIRECTORY above).
|
||||
coop_output_subdir(tests hook_selftest_x86 present_hook_test_x86 audio_hook_test_x86)
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user