From 578b13c0414fc4269083bd9fac5fdcd6ff5b5337 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 31 Jul 2022 17:19:51 +0200 Subject: [PATCH] sim/ngspice_models.cpp: compile this file always in release mode (msys2). On msys2, this file (mainly a large amount of data) compiled in debug mode crashes Eeschema at start (issue probably related to a memory issue). On msys2, binaries built in debug are always *very* large --- eeschema/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index e0de4a75ae..f936e8657c 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -6,6 +6,16 @@ endif() add_definitions( -DEESCHEMA ) +if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) + if( MSYS ) + # For some reason the big file sim/ngspice_models.cpp creates an issue when + # compiled in debug mode on msys2 + # (Probably some out of memory issue that crashes Eeschema at start) + # So compile it in release mode that generates much smaller binaries + set_source_files_properties( sim/ngspice_models.cpp PROPERTIES COMPILE_FLAGS "-O2" ) + endif() +endif() + if( KICAD_SPICE ) set( INC_AFTER ${INC_AFTER} ${NGSPICE_INCLUDE_DIR} )