mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-26 19:23:51 +01:00
link libs when needed
This commit is contained in:
@@ -38,16 +38,24 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
target_compile_definitions(libfmio PRIVATE DEBUG=1)
|
||||
endif()
|
||||
|
||||
set(FM_LIBS inih libfmfilter libfmmodulation libfmio libfmdsp pulse pulse-simple m liquid)
|
||||
|
||||
foreach(SRC_FILE ${SRC_FILES})
|
||||
get_filename_component(EXEC_NAME ${SRC_FILE} NAME_WE)
|
||||
|
||||
add_executable(${EXEC_NAME} ${SRC_FILE})
|
||||
target_compile_options(${EXEC_NAME} PRIVATE -O2 -Wall -Wextra -Werror -Wno-unused-parameter)
|
||||
target_link_libraries(${EXEC_NAME} PRIVATE ${FM_LIBS})
|
||||
|
||||
# Define DEBUG macro for Debug builds
|
||||
|
||||
if(EXEC_NAME STREQUAL "fm95")
|
||||
target_link_libraries(${EXEC_NAME} PRIVATE libfmfilter libfmmodulation libfmdsp libfmio pulse pulse-simple m liquid inih)
|
||||
elseif(EXEC_NAME STREQUAL "chimer95")
|
||||
target_link_libraries(${EXEC_NAME} PRIVATE libfmdsp inih m libfmio pulse pulse-simple)
|
||||
elseif(EXEC_NAME STREQUAL "sca95")
|
||||
target_link_libraries(${EXEC_NAME} PRIVATE libfmmodulation inih m libfmio pulse pulse-simple libfmdsp)
|
||||
elseif(EXEC_NAME STREQUAL "vban95")
|
||||
target_link_libraries(${EXEC_NAME} PRIVATE libfmio pulse pulse-simple)
|
||||
else()
|
||||
message(FATAL_ERROR "How do I link this? ${EXEC_NAME}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
target_compile_definitions(${EXEC_NAME} PRIVATE DEBUG=1)
|
||||
endif()
|
||||
@@ -57,4 +65,4 @@ foreach(SRC_FILE ${SRC_FILES})
|
||||
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
GROUP_EXECUTE GROUP_WRITE GROUP_READ
|
||||
WORLD_EXECUTE WORLD_READ)
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
@@ -102,12 +102,12 @@ static void stop(int signum) {
|
||||
(void)signum;
|
||||
printf("\nReceived stop signal.\n");
|
||||
to_run = 0;
|
||||
to_reload = 0;
|
||||
to_reload = 0; // Make sure we don't reload
|
||||
}
|
||||
static void reload(int signum) {
|
||||
(void)signum;
|
||||
printf("\nReceived reload signal.\n");
|
||||
to_run = 0;
|
||||
to_run = 0; // To run is a flag, just telling when to stop the loop
|
||||
to_reload = 1;
|
||||
}
|
||||
|
||||
@@ -141,9 +141,10 @@ int run_fm95(const FM95_Config config, FM95_Runtime* runtime) {
|
||||
bool mpx_on = (runtime->mpx_device.initialized == 1);
|
||||
bool rds_on = (runtime->rds_device.initialized == 1);
|
||||
|
||||
float output[BUFFER_SIZE];
|
||||
|
||||
if(config.calibration != 0) {
|
||||
int pulse_error;
|
||||
float output[BUFFER_SIZE];
|
||||
|
||||
while(to_run) {
|
||||
for (int i = 0; i < BUFFER_SIZE; i++) {
|
||||
@@ -166,7 +167,6 @@ int run_fm95(const FM95_Config config, FM95_Runtime* runtime) {
|
||||
float audio_stereo_input[BUFFER_SIZE*2]; // Stereo
|
||||
|
||||
float mpx_in[BUFFER_SIZE] = {0};
|
||||
float output[BUFFER_SIZE];
|
||||
|
||||
while (to_run) {
|
||||
if((pulse_error = read_PulseInputDevice(&runtime->input_device, audio_stereo_input, sizeof(audio_stereo_input)))) { // get output from the function and assign it into pulse_error, this comment to avoid confusion
|
||||
|
||||
Reference in New Issue
Block a user