Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
carrotIndustries committed Jul 2, 2023
1 parent a377fec commit 261b3c0
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
run: |
mkdir ../build
CXX=${{ matrix.os.cxx }} CC=${{ matrix.os.cc }} meson setup ../build
LD_PRELOAD=$PWD/close_range.so ninja -C ../build ${{ matrix.target }}
ninja -C ../build ${{ matrix.target }}
- name: Check version
run: python3 check_version.py
- name: Test python module
Expand Down
20 changes: 17 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ if not opencascade.found()
opencascade = dependency('OCE', method : 'cmake')
endif

# on ubuntu 20.04, the link args are broken and are missing the -l for some reason??
opencascade = declare_dependency(dependencies: opencascade.partial_dependency(compile_args: true, includes:true), link_args:['-lTKSTEP', '-lTKernel', '-lTKXCAF', '-lTKXSBase', '-lTKBRep', '-lTKCDF', '-lTKXDESTEP', '-lTKLCAF', '-lTKMath', '-lTKMesh', '-lTKTopAlgo', '-lTKPrim', '-lTKBO', '-lTKShHealing', '-lTKBRep', '-lTKG3d', '-lTKGeomBase', '-lTKHLR'])
if not cxx.links('int main(void) {return 0;}', dependencies: opencascade)
message('opencascade link args are broken, replacing')
# on ubuntu 20.04, the link args are broken and are missing the -l for some reason??
opencascade = declare_dependency(dependencies: opencascade.partial_dependency(compile_args: true, includes:true), link_args:['-lTKSTEP', '-lTKernel', '-lTKXCAF', '-lTKXSBase', '-lTKBRep', '-lTKCDF', '-lTKXDESTEP', '-lTKLCAF', '-lTKMath', '-lTKMesh', '-lTKTopAlgo', '-lTKPrim', '-lTKBO', '-lTKShHealing', '-lTKBRep', '-lTKG3d', '-lTKGeomBase', '-lTKHLR'])
endif





spnav = dependency('spnav', required: false)
if not spnav.found()
Expand Down Expand Up @@ -58,9 +65,16 @@ podofo = declare_dependency (
include_directories: include_directories('/usr/include/podofo-0.9')
)
else
podofo = dependency('libpodofo')
podofo = dependency('libpodofo09', required:false)
if podofo.found()
cpp_args += '-DINC_PODOFO_WITHOUT_DIRECTORY'
else
podofo = dependency('libpodofo')
endif
endif

#podofo_minor = cxx.get_define('PODOFO_VERSION_MINOR', prefix: '#include "util/podofo_inc.hpp"', include_directories: include_directories('src'), dependencies:podofo)

stdlibs = []
is_libstdcpp = cxx.get_define('__GLIBCXX__', prefix: '#include <vector>') != ''
if is_libstdcpp
Expand Down
2 changes: 1 addition & 1 deletion src/export_pdf/canvas_pdf.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include "canvas/canvas.hpp"
#include <podofo/podofo.h>
#include "util/podofo_inc.hpp"

namespace horizon {

Expand Down
2 changes: 1 addition & 1 deletion src/export_pdf/export_pdf.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "export_pdf.hpp"
#include "canvas_pdf.hpp"
#include <podofo/podofo.h>
#include "util/podofo_inc.hpp"
#include "util/util.hpp"
#include "schematic/schematic.hpp"
#include "export_pdf_util.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/export_pdf/export_pdf_board.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "export_pdf.hpp"
#include "canvas_pdf.hpp"
#include <podofo/podofo.h>
#include "util/podofo_inc.hpp"
#include "util/util.hpp"
#include "board/board.hpp"
#include "export_pdf_util.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/export_pdf/export_pdf_util.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <podofo/podofo.h>
#include "util/podofo_inc.hpp"
#include "util/placement.hpp"

namespace horizon {
Expand Down
2 changes: 1 addition & 1 deletion src/imp/pdf_export_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "util/util.hpp"
#include "widgets/spin_button_dim.hpp"
#include "common/layer_provider.hpp"
#include <podofo/podofo.h>
#include "util/podofo_inc.hpp"
#include "util/win32_undef.hpp"
#include <thread>

Expand Down
2 changes: 1 addition & 1 deletion src/python_module/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "image_3d_exporter_wrapper.hpp"
#include "document/document_board.hpp"
#include "rules/cache.hpp"
#include <podofo/podofo.h>
#include "util/podofo_inc.hpp"
#include "blocks/blocks.hpp"
#include "board/board.hpp"
#include "project/project.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/python_module/schematic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "export_pdf/export_pdf.hpp"
#include "export_bom/export_bom.hpp"
#include "util.hpp"
#include <podofo/podofo.h>
#include "util/podofo_inc.hpp"

SchematicWrapper::SchematicWrapper(const horizon::Project &prj)
: pool(prj.pool_directory, false), blocks(horizon::BlocksSchematic::new_from_file(prj.blocks_filename, pool))
Expand Down
5 changes: 5 additions & 0 deletions src/util/podofo_inc.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#ifdef INC_PODOFO_WITHOUT_DIRECTORY
#include <podofo.h>
#else
#include <podofo/podofo.h>
#endif

0 comments on commit 261b3c0

Please sign in to comment.