diff --git a/native/.gitignore b/native/.gitignore new file mode 100644 index 0000000..9bcdd5a --- /dev/null +++ b/native/.gitignore @@ -0,0 +1,2 @@ +build +out diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 3940797..f8f46aa 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -1,29 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(link-app-to-mic-example LANGUAGES CXX VERSION 1.0) +cmake_minimum_required(VERSION 3.2.2) +project(globalProject) -# -------------------------------------------------------------------------------------------------------- -# Create library -# -------------------------------------------------------------------------------------------------------- - -file(GLOB src "main.cpp") - -add_executable(${PROJECT_NAME} ${src}) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Werror -Wextra -pedantic) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF CXX_STANDARD_REQUIRED ON) - -# -------------------------------------------------------------------------------------------------------- -# Supply rohrkabel if example is built stand-alone -# -------------------------------------------------------------------------------------------------------- - -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - include(FetchContent) - FetchContent_Declare(rohrkabel GIT_REPOSITORY "https://github.com/Soundux/rohrkabel") - FetchContent_MakeAvailable(rohrkabel) -endif() - -# -------------------------------------------------------------------------------------------------------- -# Link required libraries -# -------------------------------------------------------------------------------------------------------- - -target_link_libraries(${PROJECT_NAME} PRIVATE rohrkabel) +add_subdirectory(message-parser) +add_subdirectory(screenaudio-mic) diff --git a/native/build.sh b/native/build.sh new file mode 100644 index 0000000..f3c0828 --- /dev/null +++ b/native/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +cmake -B build -S . +cmake --build build + +mkdir -p out +cp build/message-parser/message-parser out/ +cp build/screenaudio-mic/screenaudio-mic out/ diff --git a/native/message-parser/CMakeLists.txt b/native/message-parser/CMakeLists.txt new file mode 100644 index 0000000..88246b9 --- /dev/null +++ b/native/message-parser/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.2.2) +project(message-parser LANGUAGES CXX VERSION 1.0) + +file(GLOB src "message-parser.c") + +add_executable(${PROJECT_NAME} ${src}) diff --git a/native/message-parser.c b/native/message-parser/message-parser.c similarity index 100% rename from native/message-parser.c rename to native/message-parser/message-parser.c diff --git a/native/screenaudio-mic/CMakeLists.txt b/native/screenaudio-mic/CMakeLists.txt new file mode 100644 index 0000000..945793e --- /dev/null +++ b/native/screenaudio-mic/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.2.2) +project(screenaudio-mic LANGUAGES CXX VERSION 1.0) + +# -------------------------------------------------------------------------------------------------------- +# Create library +# -------------------------------------------------------------------------------------------------------- + +file(GLOB src "main.cpp") + +add_executable(${PROJECT_NAME} ${src}) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Werror -Wextra -pedantic) +set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF CXX_STANDARD_REQUIRED ON) + +# -------------------------------------------------------------------------------------------------------- +# Supply rohrkabel if example is built stand-alone +# -------------------------------------------------------------------------------------------------------- + +include(FetchContent) +FetchContent_Declare(rohrkabel GIT_REPOSITORY "https://github.com/Soundux/rohrkabel") +FetchContent_MakeAvailable(rohrkabel) + +# -------------------------------------------------------------------------------------------------------- +# Link required libraries +# -------------------------------------------------------------------------------------------------------- + +target_link_libraries(${PROJECT_NAME} PRIVATE rohrkabel) diff --git a/native/main.cpp b/native/screenaudio-mic/main.cpp similarity index 98% rename from native/main.cpp rename to native/screenaudio-mic/main.cpp index 645182c..165e9d2 100644 --- a/native/main.cpp +++ b/native/screenaudio-mic/main.cpp @@ -69,7 +69,7 @@ int main() auto virtual_mic = core.create("adapter", { - {"node.name", "Rohrkabel Virtual Mic"}, // + {"node.name", "screenaudio-mic"}, // {"media.class", "Audio/Source/Virtual"}, // {"factory.name", "support.null-audio-sink"}, // {"audio.channels", "2"}, //