mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-07-30 16:29:15 +02:00
link libs when needed
This commit is contained in:
+12
-4
@@ -38,16 +38,24 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||||||
target_compile_definitions(libfmio PRIVATE DEBUG=1)
|
target_compile_definitions(libfmio PRIVATE DEBUG=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(FM_LIBS inih libfmfilter libfmmodulation libfmio libfmdsp pulse pulse-simple m liquid)
|
|
||||||
|
|
||||||
foreach(SRC_FILE ${SRC_FILES})
|
foreach(SRC_FILE ${SRC_FILES})
|
||||||
get_filename_component(EXEC_NAME ${SRC_FILE} NAME_WE)
|
get_filename_component(EXEC_NAME ${SRC_FILE} NAME_WE)
|
||||||
|
|
||||||
add_executable(${EXEC_NAME} ${SRC_FILE})
|
add_executable(${EXEC_NAME} ${SRC_FILE})
|
||||||
target_compile_options(${EXEC_NAME} PRIVATE -O2 -Wall -Wextra -Werror -Wno-unused-parameter)
|
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")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
target_compile_definitions(${EXEC_NAME} PRIVATE DEBUG=1)
|
target_compile_definitions(${EXEC_NAME} PRIVATE DEBUG=1)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+4
-4
@@ -102,12 +102,12 @@ static void stop(int signum) {
|
|||||||
(void)signum;
|
(void)signum;
|
||||||
printf("\nReceived stop signal.\n");
|
printf("\nReceived stop signal.\n");
|
||||||
to_run = 0;
|
to_run = 0;
|
||||||
to_reload = 0;
|
to_reload = 0; // Make sure we don't reload
|
||||||
}
|
}
|
||||||
static void reload(int signum) {
|
static void reload(int signum) {
|
||||||
(void)signum;
|
(void)signum;
|
||||||
printf("\nReceived reload signal.\n");
|
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;
|
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 mpx_on = (runtime->mpx_device.initialized == 1);
|
||||||
bool rds_on = (runtime->rds_device.initialized == 1);
|
bool rds_on = (runtime->rds_device.initialized == 1);
|
||||||
|
|
||||||
|
float output[BUFFER_SIZE];
|
||||||
|
|
||||||
if(config.calibration != 0) {
|
if(config.calibration != 0) {
|
||||||
int pulse_error;
|
int pulse_error;
|
||||||
float output[BUFFER_SIZE];
|
|
||||||
|
|
||||||
while(to_run) {
|
while(to_run) {
|
||||||
for (int i = 0; i < BUFFER_SIZE; i++) {
|
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 audio_stereo_input[BUFFER_SIZE*2]; // Stereo
|
||||||
|
|
||||||
float mpx_in[BUFFER_SIZE] = {0};
|
float mpx_in[BUFFER_SIZE] = {0};
|
||||||
float output[BUFFER_SIZE];
|
|
||||||
|
|
||||||
while (to_run) {
|
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
|
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