Commit Graph

451 Commits

Author SHA1 Message Date
Seth Hillbrand 0b80c00678 Add Valgrind stack instrumentation
Our coroutine system can make debugging memory issues harder by not
following a standard stack allocation system.  We can get around this by
using valgrind's built-in stack instrumentation.  Each coroutine
registers a stack allocation allowing memcheck to recognize when
accesses are bounded.
2019-08-10 08:28:25 -07:00
jean-pierre charras 38fc51c3b6 CMakeLists.txt: add compil option KICAD_STDLIB_LIGHT_DEBUG, useful when KICAD_STDLIB_DEBUG cannot be used.
KICAD_STDLIB_DEBUG option generate intrusive tests and asserts, and on Windows, generate crashed not captured by GDB.
KICAD_STDLIB_LIGHT_DEBUG generate less intrusive tests and asserts.
it adds only -Wp,-D_GLIBCXX_ASSERTIONS and that generate less asserts.

Add also the new build options in dialog about.
2019-08-07 14:51:28 +02:00
Seth Hillbrand 5aa48e523d C++14: Remove libglm version hold
We can now accept all versions of libglm >= 0.9.5.1 in the master
branch.
2019-08-06 18:43:45 -07:00
Seth Hillbrand 7ed4d11f0c cmake: Add options for debugging
This adds std library assertions and address sanitizer options.

They are not yet enabled by default for debug builds as they are not
compatible with our inline assembler
2019-08-06 15:28:26 -07:00
Simon Richter a1f16f3681 Adapt CMake 3.0 compatibility code for C++14 2019-07-17 18:27:59 -07:00
Simon Richter e5463b5455 Define compiler flags for MSVC
Defines:
 - inhibit generation of #pragma comment(lib, ...) from boost
 - inhibit warnings about "unsafe" containers
 - inhibit warnings about "unsafe" C functions
 - inhibit warnings about "deprecated" POSIX functions
 - suppress min/max macros from windows.h

Flags:
 - source and execution charsets are UTF-8
 - suppress warnings about throw() not being fully supported in the compiler
 - suppress warnings about values being explicitly cast to bool
 - enable string pooling
 - enable unreferenced code removal
 - enable COMDAT folding
 - generate PDB debug information
2019-07-17 08:10:47 -04:00
Simon Richter cf4393091a Set _USE_MATH_DEFINES on Windows
All compilers need this in standards-compliant mode.
2019-07-17 08:10:47 -04:00
Seth Hillbrand 044b4a6d4c Bump C++ version to c++14
This is a provisional bump.  If supported platforms
(http://kicad-pcb.org/help/system-requirements/#_specific_system_requirements)
experience issues with this version we will revert back to c++11.

No code that requires c++14 will be committed yet.
2019-07-10 20:03:48 -07:00
Ian McInerney 42e14b5a4e Cleanup cmake python dependency handling to catch errors
* Changed the KICAD_SCRIPTING flag to be a global disable, so it
  will disable all other scripting flags when set to OFF
* Added version testing with the wxPython flags to ensure the
  proper version is found for the flags provided
2019-06-27 13:31:20 -04:00
Seth Hillbrand ffc1b6406f Remove last vestiges of WX_GRAPHICS_CONTEXT 2019-06-18 11:15:05 -07:00
jean-pierre charras b5cf03f5ad Remove boost::regex from required BOOST components, because now replaced by std::regex is used. 2019-06-18 08:22:05 +02:00
Seth Hillbrand ca12ce6f14 CMake: Bump version
Updates the minimum version to 3.0.2
2019-06-14 10:56:45 -07:00
Seth Hillbrand e52afd93a3 Remove Legacy options for overlay/context
These options were used to support the legacy canvas when drawing on
MacOS and GTK3.  With the move to 100% GAL, they are extraneous.  This
moves all DC over to "COPY" as we only use this for printing support in
Eeschema at the moment, so there is a single draw command (no erasing)
for the canvas.
2019-06-12 06:01:03 -07:00
Tomasz Włostowski 37e057173c CMakeLists: temporarily disable --no-undefined which breaks builds with ASan 2019-05-22 16:37:16 +02:00
John Beard 45aa514591 QA: Allow to build tests manually if disabled
Add a new CMake target, qa_all, which builds all
tests, tools and their deps.

Then, when KICAD_BUILD_QA_TESTS is set OFF, remove tests
and tools from the ALL target, so `make all` doesn't include
these builds.

This means even when you turn the KICAD_BUILD_QA_TESTS option
off, you still have the option to:

* Build individual tests: `make qa_pcbnew`
* Build all tests: `make qa_all_tests`
* Build all tools: `make qa_all_tools`
* Build all QA executables: `make qa_all`

This also will provide a place to hang extra logic for test routine
wrangling (e.g. by CI tools)

Update the "Compiling KiCad" dev docs.

Also, CMakeModules .cmake files should not be excluded from git
2019-04-17 18:00:40 +01:00
John Beard 03214b5dea Sexpr/QA: Split out the sexpr classes into a reusable lib and test
The SEXPR class is a useful general-purpose S-Expression library
class and can (maybe) be used else where. It also should get
test coverage, as even if noone else uses it, it's critical for the
kicad2step exporter.

Also add some test coverage for some kicad2step routines. For now,
they're not useful outside kicad2step, but they are at least a useful
reference for S-Expression parsing.
2019-04-17 10:52:56 +01:00
jean-pierre charras ead5bfe64b Add option to build QA test suite (this option is on by default.
KICAD_BUILD_QA_TESTS=OFF skips the QA test suite build.
This is useful for daily work on Kicad. It spares compil and link time.
2019-04-16 18:40:56 +02:00
Seth Hillbrand 257d9b5fe9 Allow setting the kicad config dir
This allows setting the config dir at build time, providing packagers a
method of controlling where the configuration files are placed.

Fixes: lp:1780601
* https://bugs.launchpad.net/kicad/+bug/1780601
2019-04-08 12:33:49 -07:00
Jon Evans 83c7e7fc65 New connectivity algorithm and bus upgrades
Bus upgrades: core new connectivity code

Bus upgrades: eeschema integration and modifications

Bus upgrades: eeschema dialogs

Bus upgrades: netlist export

Bus upgrades: file format changes
2019-03-31 19:53:41 -04:00
Seth Hillbrand 5619cc41f9 Remove Bsymbolic linker flag
Bsymbolic prevents DSO exceptions from being handled by the calling
application.  This was added when some toolchains did not fully support
the -fhidden-visibility setting.  Every platform now support it, so we
can remove the hammer.

See https://bugs.launchpad.net/kicad/+bug/1322354 for original details
2019-03-16 20:37:14 -07:00
Seth Hillbrand 6eb84e42f2 cmake: Remove invalid clang syntax
Clang compiler uses the same syntax for sending flags to the linker as
gcc.  If we use -XLinker, we can't use comma-separated options but
there appears to be no reason to anyway.  Removes extra warning quieting
that was added for compiling Boost in tree.
2019-03-07 13:59:18 -08:00
Seth Hillbrand 81a5bd977b Force overlay when building GTK3
GTK3 does not provide the XOR method.  We need to force the overlay to
draw items in Page Layout editor when moving/dragging
2019-02-25 14:14:44 -08:00
Thomas Pointhuber bb7c889551 Fix check for incompatible glm version in cmake
Build fails on GCC, but not with Clang. Modify the check to only catch the
cases where GLM does not work for sure.

Reference: lp:1804030
* https://bugs.launchpad.net/kicad/+bug/1804030
2019-01-09 09:24:49 -05:00
Seth Hillbrand e8333633fe GAL: Add antialiasing options to Cairo
Cairo supports antialiasing when rendering but can be slow when set to
sub-pixel mode.  This bumps the minimum version of Cairo to 1.12
(available in 14.04 LTS as well as mingw) to support three antialias
settings (fast, good, best) that offer speed/appearance tradeoffs.

This can provide a higher-quality eeschema render as it works on a
per-element basis as opposed to the OpenGL per-screen antialias.
2019-01-04 13:39:56 -08:00
Seth Hillbrand 968ea983aa GLM: Check for incompatible glm version in cmake
GLM version 0.9.9.3 has a C++11 error that causes issues for KiCad.
Earlier version function as expected.  Since GLM is header-only, forcing
the version during compilation is sufficient to ensure that the
executable functions correctly.

Fixes: lp:1804030
* https://bugs.launchpad.net/kicad/+bug/1804030
2018-12-14 16:29:18 -08:00
John Beard 4363cc0bec Docs: add docset generation target
This is a CMake (non-ALL) target that will build a Zeal-compatible
docset from a version of the doxygen HTML.

To do this, doxytag2zeal is used.
2018-12-03 10:14:15 -05:00
jean-pierre charras 95bc4f74c5 Windows compil option: always define UNICODE and_UNICODE needed by Kicad that uses unicode. 2018-11-06 18:15:52 +01:00
Maciej Suminski b7b9cccffc Moved wxPython/Phoenix detection to a separate CMake module 2018-11-02 11:28:30 +01:00
Maciej Suminski 23e574fbcd Remove a redundant semicolon in Python path configuration command 2018-11-02 10:40:05 +01:00
Maciej Suminski 179c46ce49 Handle another type of wxPython/Phoenix version string
Fixes: lp:1801109
* https://bugs.launchpad.net/kicad/+bug/1801109
2018-11-02 09:42:08 +01:00
Seth Hillbrand 672e98bd89 Phoenix: Fix wxwidget version
Phoenix reports version 4.x but wxWidgets do not follow this version.
Phoenix also does not have or require the wxPython.h file.

Fixes: lp:1801109
* https://bugs.launchpad.net/kicad/+bug/1801109
2018-11-01 08:49:51 -07:00
jean-pierre charras ad99983672 Windows build: link gdiplus library on all Windows targets, not only mingw. 2018-11-01 16:03:21 +01:00
jean-pierre charras 8be3471ba2 Windows specific: define GDI_PLUS_LIBRARIES even if USE_WX_GRAPHICS_CONTEXT is not used.
Because the cairo printing system uses gdiplus library, GDI_PLUS_LIBRARIES must be always defined
2018-11-01 08:38:23 +01:00
Maciej Suminski 38f94483f4 Warn the user about wxWidgets/Python toolkit mismatch instead of overriding the setting 2018-10-31 19:17:30 +01:00
Maciej Suminski 948f28ebcc Enforce the same toolkit version for wxWidgets and wxPython libraries
Fixes: lp:1747677
* https://bugs.launchpad.net/kicad/+bug/1747677

Fixes: lp:1783634
* https://bugs.launchpad.net/kicad/+bug/1783634
2018-10-31 19:17:30 +01:00
Wayne Stambaugh 9519de8ab2 Check for wxPython.h when wxPython scripting is enabled.
Fixes lp:1785663

https://bugs.launchpad.net/kicad/+bug/1785663
2018-10-31 10:15:32 +01:00
Thomas Pointhuber 0e0b4d52a2 Add initial support for Phoenix (new wxPython binding)
Based on the work of @mmccoo:
https://kicad.mmccoo.com/2017/11/23/learnings-from-moving-kicad-to-wxpython-4-0/
and this additional patchset to remove wxpy_api.h dependency:
http://mmccoo.com/random/0001-Remove-dependence-on-pywx_api.h.patch

Please note CreatePythonShellWindow changed quite a lot. Throughful testing
should be made for the old as well as new wxPython version on all platforms
2018-10-26 13:21:11 +02:00
Seth Hillbrand 40c70dd008 Prevent excess precision errors on 32-bit builds
The compile flag -ffloat-store requires floating point values to be
stored in memory rather than in registers to prevent errors when two
numbers are compared that were stored in different locations.
2018-10-23 15:27:58 -07:00
Wayne Stambaugh 8a251163dc Revert "Turn off compiler extensions"
The compiler option caused build failures on msys2.

This reverts commit 2c22bb1a60.
2018-10-19 18:19:45 -04:00
Simon Richter cc0489f6b5 Disallow variable length arrays
This is a gcc/clang extension, not standard C++
2018-10-19 10:25:32 -07:00
Simon Richter 2c22bb1a60 Turn off compiler extensions
We want to be somewhat standards compliant if we can.
2018-10-19 10:25:05 -07:00
Thomas Pointhuber 4a2a76af37 Improve CMake Python code
* We have code with u'' which means minimum version is 3.3
* Python 3.8 is already in development, be a bit more future proof
2018-10-19 09:59:06 +02:00
Thomas Pointhuber 86ecb9fe30 Fix cmake script for PythonLibs 2018-10-19 09:59:06 +02:00
Thomas Pointhuber 7548a3b1bf Add KICAD_SCRIPTING_PYTHON3 flag to about dialog and doc 2018-10-19 09:59:05 +02:00
Thomas Pointhuber 1a11480bfd Add cmake flag to switch to python3 build 2018-10-19 09:59:05 +02:00
Thomas Pointhuber de7b362695 Rewrite some code to work on Python 2.7 and 3+ 2018-10-19 09:59:03 +02:00
Seth Hillbrand f8784f30a8 Removing OpenMP
This commit finishes the removal of OpenMP from the KiCad codebase.
Removed in this commit are the OpenMP calls in 3d-viewer and
qa/polygon_triangulation as well as all references in CMakeLists.txt

std::thread is used instead for multithreaded computation
2018-09-21 12:44:20 -07:00
Damian Wrobel f85b1479aa Fix setting default cmake build type
Changes: Sets default cmake build type before
calling project(). Current version seems to follow
https://cmake.org/pipermail/cmake/2008-September/023808.html
however, it seems to miss the comment that:
"definition of CMAKE_BUILD_TYPE occurs in the PROJECT() command"
which means that setting cmake build type should happend prior
to calling PROJECT().

Fixes: lp:1785719
* https://bugs.launchpad.net/kicad/+bug/1785719
2018-09-05 08:12:03 -04:00
Wayne Stambaugh f52da8ed96 Pcbnew: enable scripting action menu build option by default.
Fixes lp:1783690

https://bugs.launchpad.net/kicad/+bug/1783690
2018-08-21 12:54:13 -04:00
Maciej Suminski 01925fd6a7 Changed the OpenGL CMake preference to LEGACY
Certain distribution does not handle GLVND well, as the result the
accelerated canvas is not enabled. For the time being it is better to
keep using the legacy preference.

Thanks to Aurelio Lucchesi for investigating the cause.

Fixes: lp:1781581
* https://bugs.launchpad.net/kicad/+bug/1781581
2018-08-17 10:03:59 +02:00