From cc793bdc4da4ac1399d24b52189b9bbf4ae98eb1 Mon Sep 17 00:00:00 2001 From: bruceperens Date: Tue, 18 Mar 2014 22:32:56 +0000 Subject: [PATCH] Add platform header. git-svn-id: https://svn.code.sf.net/p/freetel/code@1452 01035d8c-6547-0410-b346-abe4f91aad63 --- freedv-server/CMakeLists.txt | 32 +++++++++---------- freedv-server/source/drivers.h | 2 +- .../source/platform/posix/platform.h | 6 ++++ 3 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 freedv-server/source/platform/posix/platform.h diff --git a/freedv-server/CMakeLists.txt b/freedv-server/CMakeLists.txt index 97c6aeee..15781a23 100644 --- a/freedv-server/CMakeLists.txt +++ b/freedv-server/CMakeLists.txt @@ -87,21 +87,30 @@ message(STATUS "${Param.build-type} ${Version.major}.${Version.minor}.${Version. # Set cmake internal variables from parameters. # +set(Compile.posix.sources + source/platform/posix/scheduler.cpp + source/platform/posix/privilege.cpp +) set(Compile.linux.sources + ${Compile.posix.sources} source/platform/linux/alsa.cpp source/platform/linux/audio_out_alsa.cpp source/platform/linux/audio_in_alsa.cpp - source/platform/linux/scheduler.cpp - source/platform/linux/privilege.cpp ) + set(Compile.linux.libraries asound ) +set(Compile.linux.header_dirs + source/platform/posix +) + # FIX: Add other platforms. if(Platform.name STREQUAL Linux) set(Compile.platform.sources ${Compile.linux.sources}) set(Compile.platform.libraries ${Compile.linux.libraries}) + set(Compile.platform.header_dirs ${Compile.linux.header_dirs}) endif(Platform.name STREQUAL Linux) set(Compile.sources @@ -113,11 +122,11 @@ set(Compile.sources source/audio_output.cpp source/audio_sink.cpp source/base.cpp + source/big_main.cpp source/blank_panel.cpp source/codec.cpp source/codec_noop.cpp source/driver_manager.cpp - source/event_handler.cpp source/fifo.cpp source/framer.cpp source/framer_noop.cpp @@ -125,7 +134,6 @@ set(Compile.sources source/io_device.cpp source/keying.cpp source/keying_sink.cpp - source/libevent.cpp source/modem.cpp source/modem_noop.cpp source/ptt_constant.cpp @@ -138,16 +146,6 @@ set(Compile.sources source/utility.cpp ) -set(Optional.sources - source/big_main.cpp - source/tiny_main.cpp -) - -set(Optional.sources - source/big_main.cpp - source/tiny_main.cpp -) - set(Test.sources source/test/audio_sink.cpp source/test/base.cpp @@ -164,10 +162,12 @@ set(Test.headers ) load_parameters(cxx-flags) -set_source_files_properties(${Compile.sources} ${Optional.sources} ${Test.sources} PROPERTIES COMPILE_FLAGS ${Param.cxx-flags}) +set_source_files_properties(${Compile.sources} ${Test.sources} PROPERTIES COMPILE_FLAGS ${Param.cxx-flags}) + +add_executable(freedv-server ${Compile.sources}) -add_executable(freedv-server ${Compile.sources} source/big_main.cpp) +include_directories(${Compile.platform.header_dirs}) # Googletest unit testing. add_subdirectory(googletest) diff --git a/freedv-server/source/drivers.h b/freedv-server/source/drivers.h index bf147c1d..6047055c 100644 --- a/freedv-server/source/drivers.h +++ b/freedv-server/source/drivers.h @@ -2,7 +2,7 @@ #include #include #include -#include +#include "platform.h" /// Namespace used for all code in this program. namespace FreeDV { diff --git a/freedv-server/source/platform/posix/platform.h b/freedv-server/source/platform/posix/platform.h new file mode 100644 index 00000000..e6e38dcb --- /dev/null +++ b/freedv-server/source/platform/posix/platform.h @@ -0,0 +1,6 @@ +#include + +namespace FreeDV { + /// Type used by poll_fds(). For portability to Windows. + typedef struct pollfd PollType; +} -- 2.25.1