Browse Source

Added precompiled header support

- PCBNew
- Schematic Editor
- Common libs
pull/18/head
Seth Hillbrand 3 months ago
parent
commit
267b21d81c
  1. 30
      common/CMakeLists.txt
  2. 12
      eeschema/CMakeLists.txt
  3. 36
      eeschema/sim/sim_model_tline.cpp
  4. 10
      pcbnew/CMakeLists.txt

30
common/CMakeLists.txt

@ -239,6 +239,19 @@ add_library( kicommon SHARED
${KICOMMON_SRCS}
)
target_precompile_headers( kicommon
PRIVATE
<kicommon.h>
<algorithm>
<map>
<memory>
<optional>
<set>
<string>
<vector>
<wx/wx.h>
)
set_target_properties(kicommon PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_link_libraries( kicommon
@ -736,6 +749,11 @@ add_library( common STATIC
${COMMON_SRCS}
)
target_precompile_headers( common
PRIVATE
$<TARGET_PROPERTY:kicommon,PRECOMPILE_HEADERS>
)
add_dependencies( common version_header )
add_dependencies( common compoundfilereader ) # used by altium_parser.cpp
@ -907,6 +925,18 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
target_precompile_headers( pcbcommon
PRIVATE
<vector>
<map>
<memory>
<unordered_map>
<board.h>
<footprint.h>
<zone.h>
<connectivity/connectivity_data.h>
<drc/drc_engine.h> )
target_include_directories( pcbcommon PRIVATE
)

12
eeschema/CMakeLists.txt

@ -576,6 +576,18 @@ add_library( eeschema_kiface_objects OBJECT
${EESCHEMA_COMMON_SRCS}
)
target_precompile_headers( eeschema_kiface_objects
PRIVATE
<vector>
<map>
<memory>
<unordered_map>
<sch_edit_frame.h>
<string_utils.h>
<schematic.h>
<pgm_base.h>
<wx/wx.h> )
target_include_directories( eeschema_kiface_objects
PUBLIC
.

36
eeschema/sim/sim_model_tline.cpp

@ -26,7 +26,7 @@
#include <fmt/core.h>
using PARAM = SIM_MODEL::PARAM;
using SIMPARAM = SIM_MODEL::PARAM;
std::string SPICE_GENERATOR_TLINE::ModelLine( const SPICE_ITEM& aItem ) const
@ -74,18 +74,18 @@ std::string SPICE_GENERATOR_TLINE::ModelLine( const SPICE_ITEM& aItem ) const
SIM_MODEL_TLINE::SIM_MODEL_TLINE( TYPE aType ) :
SIM_MODEL( aType, std::make_unique<SPICE_GENERATOR_TLINE>( *this ) )
{
static std::vector<PARAM::INFO> z0 = makeZ0ParamInfos();
static std::vector<PARAM::INFO> rlgc = makeRlgcParamInfos();
static std::vector<SIMPARAM::INFO> z0 = makeZ0ParamInfos();
static std::vector<SIMPARAM::INFO> rlgc = makeRlgcParamInfos();
switch( aType )
{
case TYPE::TLINE_Z0:
for( const PARAM::INFO& paramInfo : z0 )
for( const SIMPARAM::INFO& paramInfo : z0 )
AddParam( paramInfo );
break;
case TYPE::TLINE_RLGC:
for( const PARAM::INFO& paramInfo : rlgc )
for( const SIMPARAM::INFO& paramInfo : rlgc )
AddParam( paramInfo );
break;
@ -96,15 +96,15 @@ SIM_MODEL_TLINE::SIM_MODEL_TLINE( TYPE aType ) :
}
std::vector<PARAM::INFO> SIM_MODEL_TLINE::makeZ0ParamInfos()
std::vector<SIMPARAM::INFO> SIM_MODEL_TLINE::makeZ0ParamInfos()
{
std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo = {};
std::vector<SIMPARAM::INFO> paramInfos;
SIMPARAM::INFO paramInfo = {};
paramInfo.name = "z0";
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
paramInfo.unit = "Ω";
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
paramInfo.category = SIMPARAM::CATEGORY::PRINCIPAL;
paramInfo.defaultValue = "";
paramInfo.description = "Characteristic impedance";
paramInfo.isSpiceInstanceParam = false;
@ -114,7 +114,7 @@ std::vector<PARAM::INFO> SIM_MODEL_TLINE::makeZ0ParamInfos()
paramInfo.name = "td";
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
paramInfo.unit = "s";
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
paramInfo.category = SIMPARAM::CATEGORY::PRINCIPAL;
paramInfo.defaultValue = "";
paramInfo.description = "Transmission delay";
paramInfo.isSpiceInstanceParam = false;
@ -125,15 +125,15 @@ std::vector<PARAM::INFO> SIM_MODEL_TLINE::makeZ0ParamInfos()
}
std::vector<PARAM::INFO> SIM_MODEL_TLINE::makeRlgcParamInfos()
std::vector<SIMPARAM::INFO> SIM_MODEL_TLINE::makeRlgcParamInfos()
{
std::vector<PARAM::INFO> paramInfos;
PARAM::INFO paramInfo = {};
std::vector<SIMPARAM::INFO> paramInfos;
SIMPARAM::INFO paramInfo = {};
paramInfo.name = "len";
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
paramInfo.unit = "m";
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
paramInfo.category = SIMPARAM::CATEGORY::PRINCIPAL;
paramInfo.defaultValue = "";
paramInfo.description = "Length";
paramInfo.isSpiceInstanceParam = false;
@ -143,7 +143,7 @@ std::vector<PARAM::INFO> SIM_MODEL_TLINE::makeRlgcParamInfos()
paramInfo.name = "r";
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
paramInfo.unit = "Ω/m";
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
paramInfo.category = SIMPARAM::CATEGORY::PRINCIPAL;
paramInfo.defaultValue = "0";
paramInfo.description = "Resistance per length";
paramInfo.isSpiceInstanceParam = false;
@ -153,7 +153,7 @@ std::vector<PARAM::INFO> SIM_MODEL_TLINE::makeRlgcParamInfos()
paramInfo.name = "l";
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
paramInfo.unit = "H/m";
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
paramInfo.category = SIMPARAM::CATEGORY::PRINCIPAL;
paramInfo.defaultValue = "0";
paramInfo.description = "Inductance per length";
paramInfo.isSpiceInstanceParam = false;
@ -163,7 +163,7 @@ std::vector<PARAM::INFO> SIM_MODEL_TLINE::makeRlgcParamInfos()
paramInfo.name = "g";
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
paramInfo.unit = "1/(Ω m)";
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
paramInfo.category = SIMPARAM::CATEGORY::PRINCIPAL;
paramInfo.defaultValue = "0";
paramInfo.description = "Conductance per length";
paramInfo.isSpiceInstanceParam = false;
@ -173,7 +173,7 @@ std::vector<PARAM::INFO> SIM_MODEL_TLINE::makeRlgcParamInfos()
paramInfo.name = "c";
paramInfo.type = SIM_VALUE::TYPE_FLOAT;
paramInfo.unit = "F/m";
paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
paramInfo.category = SIMPARAM::CATEGORY::PRINCIPAL;
paramInfo.defaultValue = "0";
paramInfo.description = "Capacitance per length";
paramInfo.isSpiceInstanceParam = false;

10
pcbnew/CMakeLists.txt

@ -720,6 +720,16 @@ add_library( pcbnew_kiface_objects OBJECT
${PCBNEW_SCRIPTING_SRCS}
)
target_precompile_headers( pcbnew_kiface_objects
PRIVATE
<vector>
<map>
<memory>
<unordered_map>
"board.h"
"footprint.h"
<macros.h> )
# auto-generate specctra_lexer.h and specctra_keywords.cpp
make_lexer(
pcbnew_kiface_objects

Loading…
Cancel
Save