Skip to content

Commit

Permalink
Merge branch 'cmake-unity-build' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rjonaitis committed Sep 9, 2024
2 parents 2b3d4db + 2b79b09 commit 3d4b1b2
Show file tree
Hide file tree
Showing 80 changed files with 880 additions and 369 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install GNURadio
- name: Add GNURadio PPA
if: ${{ matrix.os == 'ubuntu-22.04'}}
run: |
sudo add-apt-repository ppa:gnuradio/gnuradio-releases
- name: Install GNURadio
if: ${{ matrix.os != 'ubuntu-20.04'}}
run: |
sudo apt-get update
sudo apt-get install -qq gnuradio-dev python3-packaging
Expand All @@ -39,7 +43,7 @@ jobs:
sudo ${{github.workspace}}/install_dependencies.sh
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} -DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{env.CMAKE_OPTIONS}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} -DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{env.CMAKE_OPTIONS}} -DCMAKE_UNITY_BUILD=false

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel ${{env.CMAKE_BUILD_PARALLEL_LEVEL}}
Expand Down Expand Up @@ -78,11 +82,10 @@ jobs:

- name: Install dependencies
# GNURadio plugin fails to build due to issues with spdlog dependency
# gnuradio pybind11 castxml
run: brew install wxwidgets soapysdr
run: brew install wxwidgets soapysdr gnuradio pybind11 castxml

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{env.CMAKE_OPTIONS}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{env.CMAKE_OPTIONS}} -DCMAKE_UNITY_BUILD=false

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel ${{env.CMAKE_BUILD_PARALLEL_LEVEL}}
28 changes: 28 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,34 @@ if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()

set(CPP_STL_PCH
<array>
<atomic>
<algorithm>
<cassert>
<chrono>
<cmath>
<cstdint>
<cstring>
<filesystem>
<fstream>
<functional>
<iostream>
<list>
<limits>
<random>
<set>
<string>
<string_view>
<map>
<memory>
<mutex>
<thread>
<unordered_map>
<vector>
<queue>
)

#########################################################################
# externals
#########################################################################
Expand Down
30 changes: 30 additions & 0 deletions GUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,34 @@ endif()

include(${wxWidgets_USE_FILE})

set(WXWIDGETS_PCH
<wx/panel.h>
<wx/button.h>
<wx/checkbox.h>
<wx/choice.h>
<wx/combobox.h>
<wx/dialog.h>
<wx/event.h>
<wx/frame.h>
<wx/combobox.h>
<wx/notebook.h>
<wx/msgdlg.h>
<wx/radiobox.h>
<wx/radiobut.h>
<wx/scrolbar.h>
<wx/sizer.h>
<wx/spinctrl.h>
<wx/statbox.h>
<wx/stattext.h>
<wx/string.h>
<wx/textctrl.h>
<wx/timer.h>
)

add_executable(limeGUI resources/resource.rc)
target_precompile_headers(limeGUI
PRIVATE ${CPP_STL_PCH} ${WXWIDGETS_PCH}
)

set(BINARY_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin")
set_target_properties(limeGUI PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BINARY_OUTPUT_DIR})
Expand All @@ -96,6 +123,9 @@ target_sources(
SDRConfiguration_view.cpp
parsers/CoefficientFileParser.cpp)

set_source_files_properties(fftviewer_wxgui/fftviewer_wxgui.cpp fftviewer_wxgui/fftviewer_frFFTviewer.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION true)
set_source_files_properties(oglGraph/dlgMarkers.cpp oglGraph//GLFont.cpp oglGraph/OpenGLGraph.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION true)

target_include_directories(
limeGUI
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion GUI/chips/LMS7002M/lms7002_mainPanel.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <assert.h>
#include <cassert>
#include "commonWxHeaders.h"
#include "lms7002_mainPanel.h"
#include "lms7002_pnlAFE_view.h"
Expand Down
2 changes: 1 addition & 1 deletion GUI/chips/LMS7002M/lms7002_pnlRFE_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <wx/msgdlg.h>
#include <map>
#include <vector>
#include <assert.h>
#include <cassert>
#include "lms7002_gui_utilities.h"
#include "numericSlider.h"
#include <tuple>
Expand Down
2 changes: 1 addition & 1 deletion GUI/chips/LMS7002M/lms7002_pnlSX_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <wx/msgdlg.h>
#include <wx/spinctrl.h>
#include <map>
#include <assert.h>
#include <cassert>
#include "numericSlider.h"
#include "lms7002_gui_utilities.h"
#include "events.h"
Expand Down
1 change: 0 additions & 1 deletion GUI/chips/Si5351C/Si5351C_wxgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <wx/button.h>
#include <wx/radiobox.h>
#include <string>
#include "limesuiteng/SDRDevice.h"

namespace lime {
class SDRDevice;
Expand Down
1 change: 0 additions & 1 deletion GUI/commonWxHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <wx/radiobox.h>
#include <wx/radiobut.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/statbox.h>
#include <wx/checkbox.h>
#include <wx/choice.h>
4 changes: 2 additions & 2 deletions GUI/oglGraph/OpenGLGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const int OpenGLGraph::GLCanvasAttributes[8] = {

bool OpenGLGraph::hasNotRecentEnoughOpenGLVersionWarningBeenThrownYet = false;

static bool IsGlew1_5()
static bool CanUseVBO()
{
#ifdef __GNUC__
#pragma GCC diagnostic push
Expand Down Expand Up @@ -700,7 +700,7 @@ void OpenGLGraph::Draw()

switchToDataView();

if (settings.useVBO && IsGlew1_5())
if (settings.useVBO && CanUseVBO())
{
for (std::size_t i = 0; i < series.size(); i++)
{
Expand Down
4 changes: 4 additions & 0 deletions GUI/oglGraph/OpenGLGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
#ifndef OPENGL_GRAPH
#define OPENGL_GRAPH

#include "GL/glew.h" // must be included before wx/glcanvas.h
#include <wx/glcanvas.h>
#ifdef __unix__
#undef Success // somewhere in X11 headers is defined Success 0, it pollutes global scope
#endif
#include <wx/menu.h>

class wxTimer;
Expand Down
22 changes: 15 additions & 7 deletions cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,38 @@ endif()
# common functionality among cli tools
add_library(cli-shared STATIC common.cpp)
target_include_directories(cli-shared PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(cli-shared PUBLIC limesuiteng)
target_link_libraries(cli-shared PUBLIC limesuiteng taywee::args)

target_precompile_headers(cli-shared PRIVATE ${CPP_STL_PCH} \"args.hxx\")

add_executable(limeDevice limeDevice.cpp)
set_target_properties(limeDevice PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
target_link_libraries(limeDevice PRIVATE cli-shared taywee::args)
target_link_libraries(limeDevice PRIVATE cli-shared)
target_precompile_headers(limeDevice REUSE_FROM cli-shared)

add_executable(limeSPI limeSPI.cpp)
set_target_properties(limeSPI PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
target_link_libraries(limeSPI PRIVATE cli-shared taywee::args)
target_link_libraries(limeSPI PRIVATE cli-shared)
target_precompile_headers(limeSPI REUSE_FROM cli-shared)

add_executable(limeConfig limeConfig.cpp)
set_target_properties(limeConfig PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
target_link_libraries(limeConfig PRIVATE cli-shared taywee::args)
target_link_libraries(limeConfig PRIVATE cli-shared)
target_precompile_headers(limeConfig REUSE_FROM cli-shared)

add_executable(limeFLASH limeFLASH.cpp)
set_target_properties(limeFLASH PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
target_link_libraries(limeFLASH PRIVATE cli-shared taywee::args)
target_link_libraries(limeFLASH PRIVATE cli-shared)
target_precompile_headers(limeFLASH REUSE_FROM cli-shared)

add_executable(limeTRX limeTRX.cpp)
set_target_properties(limeTRX PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
target_link_libraries(limeTRX PRIVATE cli-shared kissfft taywee::args)
target_link_libraries(limeTRX PRIVATE cli-shared kissfft)
target_precompile_headers(limeTRX REUSE_FROM cli-shared)

add_executable(limeOEM limeOEM.cpp)
set_target_properties(limeOEM PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
target_link_libraries(limeOEM PRIVATE cli-shared taywee::args)
target_link_libraries(limeOEM PRIVATE cli-shared)
target_precompile_headers(limeOEM REUSE_FROM cli-shared)

install(TARGETS limeDevice limeSPI limeFLASH limeTRX limeConfig limeOEM DESTINATION bin)
2 changes: 2 additions & 0 deletions cli/common.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "common.h"

#include "limesuiteng/SDRDevice.h"

using namespace lime;
using namespace std::literals::string_literals;
using namespace std::literals::string_view_literals;
Expand Down
5 changes: 2 additions & 3 deletions cli/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <chrono>
#include <vector>
#include <stdint.h>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <iostream>
Expand All @@ -15,9 +15,8 @@

#include "limesuiteng/DeviceHandle.h"
#include "limesuiteng/DeviceRegistry.h"
#include "limesuiteng/SDRDevice.h"
#include "limesuiteng/SDRDescriptor.h"
#include "limesuiteng/Logger.h"
#include "limesuiteng/SDRDevice.h"

lime::SDRDevice* ConnectToFilteredOrDefaultDevice(const std::string_view argument);

Expand Down
2 changes: 2 additions & 0 deletions cli/limeConfig.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "common.h"

#include "limesuiteng/SDRDescriptor.h"
#include "limesuiteng/LMS7002M.h"
#include "limesuiteng/Logger.h"

#include <cassert>
#include <cstring>
#include <string_view>
Expand Down
2 changes: 2 additions & 0 deletions cli/limeDevice.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "common.h"
#include "args.hxx"

#include "limesuiteng/SDRDescriptor.h"

using namespace std;
using namespace lime;
using namespace std::literals::string_literals;
Expand Down
2 changes: 2 additions & 0 deletions cli/limeFLASH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include <filesystem>
#include "args.hxx"

#include "limesuiteng/SDRDescriptor.h"

using namespace std;
using namespace lime;

Expand Down
6 changes: 5 additions & 1 deletion cli/limeOEM.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "common.h"

#include "limesuiteng/SDRDescriptor.h"
#include "limesuiteng/OpStatus.h"
#include "OEMTesting.h"

#include <assert.h>
#include <cstring>
#include <sstream>
Expand All @@ -10,6 +12,8 @@
#include "utilities/toString.h"
#include "args.hxx"

#include "OEMTesting.h"

using namespace std;
using namespace lime;
using namespace std::literals::string_literals;
Expand Down
2 changes: 2 additions & 0 deletions cli/limeSPI.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "common.h"

#include "limesuiteng/SDRDescriptor.h"

#include <cassert>
#include <cstring>
#include <filesystem>
Expand Down
3 changes: 3 additions & 0 deletions cli/limeTRX.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "common.h"

#include "limesuiteng/SDRDescriptor.h"

#include "limesuiteng/StreamConfig.h"
#include "limesuiteng/StreamComposite.h"
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion embedded/include/limesuiteng/embedded/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#include <linux/types.h>
#endif

#endif // LIMESUITENG_EMBEDDED_TYPES_H
#endif // LIMESUITENG_EMBEDDED_TYPES_H
1 change: 1 addition & 0 deletions plugins/Soapy_limesuiteng/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "limesuiteng/DeviceHandle.h"
#include "limesuiteng/Logger.h"
#include "limesuiteng/SDRDevice.h"
#include "limesuiteng/SDRDescriptor.h"
#include "utilities/toString.h"

Expand Down
6 changes: 5 additions & 1 deletion plugins/Soapy_limesuiteng/Soapy_limesuiteng.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
/**
@file Soapy_limesuiteng.h
@brief Header for Soapy SDR + IConnection bindings.
Expand All @@ -7,7 +8,6 @@
#include <SoapySDR/Device.hpp>

#include "limesuiteng/DeviceRegistry.h"
#include "limesuiteng/SDRDevice.h"
#include "limesuiteng/StreamConfig.h"

#include <array>
Expand All @@ -19,6 +19,10 @@

struct IConnectionStream;

namespace lime {
class SDRDevice;
}

class Soapy_limesuiteng : public SoapySDR::Device
{
public:
Expand Down
Loading

0 comments on commit 3d4b1b2

Please sign in to comment.