From 4ecca013921f0bbbeea32cd0307eb8b2ae0e48dd Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Mon, 6 May 2024 02:26:13 +0300 Subject: [PATCH] Improve build times by not leaking everywhere. --- pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp | 6 ++++-- thirdparty/nlohmann_json/CMakeLists.txt | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp b/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp index d15b2bc2a8..66b26ac217 100644 --- a/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp +++ b/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp @@ -625,7 +625,9 @@ std::unique_ptr PCB_IO_EASYEDAPRO_PARSER::createPAD( FOOTPRINT* if( line.at( 14 ).is_number() ) drill_dir = line.at( 14 ); - if( padHole.at( 0 ) == wxS( "ROUND" ) || padHole.at( 0 ) == wxS( "SLOT" ) ) + wxString holeShape = padHole.at( 0 ); + + if( holeShape == wxS( "ROUND" ) || holeShape == wxS( "SLOT" ) ) { VECTOR2D drill; drill.x = padHole.at( 1 ); @@ -636,7 +638,7 @@ std::unique_ptr PCB_IO_EASYEDAPRO_PARSER::createPAD( FOOTPRINT* if( std::abs( deg ) >= 45 ) std::swap( drill.x, drill.y ); // KiCad doesn't support arbitrary hole direction - if( padHole.at( 0 ) == wxS( "SLOT" ) ) + if( holeShape == wxS( "SLOT" ) ) { pad->SetDrillShape( PAD_DRILL_SHAPE_OBLONG ); } diff --git a/thirdparty/nlohmann_json/CMakeLists.txt b/thirdparty/nlohmann_json/CMakeLists.txt index 9b9420b29a..2e198e1a25 100644 --- a/thirdparty/nlohmann_json/CMakeLists.txt +++ b/thirdparty/nlohmann_json/CMakeLists.txt @@ -2,6 +2,9 @@ add_library( nlohmann_json INTERFACE ) target_include_directories( nlohmann_json INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -target_sources( nlohmann_json INTERFACE +target_sources( nlohmann_json INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/nlohmann/json.hpp - ) \ No newline at end of file + ) + +# Reduces build times +target_compile_definitions( nlohmann_json INTERFACE JSON_HAS_FILESYSTEM=0 ) \ No newline at end of file