Re: [Kicad-developers] [PATCH] Adapt CMake 3.0 compatibility code for C++14

2019-07-18 Thread Seth Hillbrand

On 2019-07-17 13:53, Simon Richter wrote:

Hi,

On Wed, Jul 17, 2019 at 01:24:26PM -0400, Seth Hillbrand wrote:


Any reason to be using the gnu++14 extensions?  I thought we were
trying to stay with the vanilla c++14.


I went for consistency. This code is pretty much unused anyway, since 
it
only handles the very old CMake versions that don't know the properties 
--
that's why there is a version check in front that causes a fatal error 
if
someone bumps the minimum CMake version without removing the 
compatibility

code.

We currently have the respective compiler extensions enabled (both GNU 
and

Visual Studio), because we don't have

set( CMAKE_CXX_EXTENSIONS OFF )

The problem is that doing that breaks msys2 builds with wx 3.0, because 
gcc

provides a POSIX-compliant strlen implementation as an extension that
becomes unavailable in standards-compliant mode. A wx header decides to
redirect missing functions to replacements in the DLL, but building the 
DLL

with extensions enabled means that the function is missing -- so builds
with -std=c++14 fail to link with a missing symbol.

I dimly remember that this is fixed in wx 3.1 (just provide the CRT
functions unconditionally), but I can't find the bug report anymore.

   Simon



Got it.  Thanks Simon!  Patch is pushed.

Best-
Seth

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] Adapt CMake 3.0 compatibility code for C++14

2019-07-17 Thread Simon Richter
Hi,

On Wed, Jul 17, 2019 at 01:24:26PM -0400, Seth Hillbrand wrote:

> Any reason to be using the gnu++14 extensions?  I thought we were
> trying to stay with the vanilla c++14.

I went for consistency. This code is pretty much unused anyway, since it
only handles the very old CMake versions that don't know the properties --
that's why there is a version check in front that causes a fatal error if
someone bumps the minimum CMake version without removing the compatibility
code.

We currently have the respective compiler extensions enabled (both GNU and
Visual Studio), because we don't have

set( CMAKE_CXX_EXTENSIONS OFF )

The problem is that doing that breaks msys2 builds with wx 3.0, because gcc
provides a POSIX-compliant strlen implementation as an extension that
becomes unavailable in standards-compliant mode. A wx header decides to
redirect missing functions to replacements in the DLL, but building the DLL
with extensions enabled means that the function is missing -- so builds
with -std=c++14 fail to link with a missing symbol.

I dimly remember that this is fixed in wx 3.1 (just provide the CRT
functions unconditionally), but I can't find the bug report anymore.

   Simon

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] Adapt CMake 3.0 compatibility code for C++14

2019-07-17 Thread Seth Hillbrand

Thanks Simon!  Not sure how I missed that one.

Any reason to be using the gnu++14 extensions?  I thought we were trying 
to stay with the vanilla c++14.


-Seth

On 2019-07-17 13:11, Simon Richter wrote:

---
 CMakeLists.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH] Adapt CMake 3.0 compatibility code for C++14

2019-07-17 Thread Simon Richter
---
 CMakeLists.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 85b029786..cb41e0c15 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -201,12 +201,12 @@ endif()
 if( CMAKE_VERSION VERSION_LESS 3.1 AND ( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) )
 include(CheckCXXCompilerFlag)
 
-CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+CHECK_CXX_COMPILER_FLAG("-std=gnu++14" COMPILER_SUPPORTS_CXX14)
 
-if(COMPILER_SUPPORTS_CXX11)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+if(COMPILER_SUPPORTS_CXX14)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
 else()
-message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
 endif()
 endif()
 
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp