summaryrefslogtreecommitdiff
path: root/xW/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-07-27 16:05:32 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-07-27 16:06:41 +0200
commitfcd1b8e0110182bbb53a5b9a2e797f6ec1e1657e (patch)
tree556d32d1b3addc36cb0bef0c7c302a7654306087 /xW/CMakeLists.txt
parent3d345987c38b6a5ded0a5c66cb00de089b5e7cc5 (diff)
downloadxK-fcd1b8e0110182bbb53a5b9a2e797f6ec1e1657e.tar.gz
xK-fcd1b8e0110182bbb53a5b9a2e797f6ec1e1657e.tar.xz
xK-fcd1b8e0110182bbb53a5b9a2e797f6ec1e1657e.zip
xW: improve beeping
This adds yet another build dependency, but it's better than the alternatives of handling it in code.
Diffstat (limited to 'xW/CMakeLists.txt')
-rw-r--r--xW/CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/xW/CMakeLists.txt b/xW/CMakeLists.txt
index 7af0e31..dc3e5c9 100644
--- a/xW/CMakeLists.txt
+++ b/xW/CMakeLists.txt
@@ -59,6 +59,13 @@ function (icon_for_win32 ico pngs pngs_raw)
COMMENT "Generating Windows program icon" VERBATIM)
endfunction ()
+# Produce a beep sample
+find_program (sox_EXECUTABLE sox ${find_program_REQUIRE})
+add_custom_command (OUTPUT beep.wav
+ COMMAND ${sox_EXECUTABLE} -b 16 -Dr 44100 -n beep.wav
+ synth 0.1 0 25 triangle 800 vol 0.5 fade t 0 -0 0.005 pad 0 0.05
+ COMMENT "Generating a beep sample" VERBATIM)
+
# Rasterize SVG icons
set (icon_ico_list)
foreach (icon xW xW-highlighted)
@@ -76,7 +83,8 @@ foreach (icon xW xW-highlighted)
list (APPEND icon_ico_list ${icon_ico})
endforeach ()
-set_property (SOURCE xW.rc APPEND PROPERTY OBJECT_DEPENDS ${icon_ico_list})
+set_property (SOURCE xW.rc
+ APPEND PROPERTY OBJECT_DEPENDS ${icon_ico_list} beep.wav)
# Build the main executable and link it
set (root "${PROJECT_SOURCE_DIR}/..")
@@ -97,7 +105,7 @@ add_custom_target (xC-proto DEPENDS ${PROJECT_BINARY_DIR}/xC-proto.cpp)
add_executable (xW WIN32 xW.cpp xW.rc xW.manifest ${project_config}
${root}/liberty/tools/lxdrgen-cpp-win32.cpp)
-target_link_libraries (xW comctl32 ws2_32)
+target_link_libraries (xW comctl32 ws2_32 winmm)
add_dependencies (xW xC-proto)
# At least with MinGW, this is a fully independent portable executable