Turn off compiler extensions
We want to be somewhat standards compliant if we can. There is a small complication, which we work around: gcc sets __STRICT_ANSI__ in "c++11" mode (the non-strict mode would be "gnu++11"), which causes the "strdup" definition to go away. If wx < 3.1 is compiled with GNU extensions, it just forwards the wxCRT strdup function to system strdup and doesn't create a definition for the wxCRT function, and when a program is then compiled in strict mode against that, the wxCRT function is missing. From 3.1 onwards, the function is provided unconditionally in wx, so the workaround is no longer needed there.
This commit is contained in:
parent
b51ca1ab0e
commit
d339979c28
|
@ -164,6 +164,7 @@ set( CMAKE_POSITION_INDEPENDENT_CODE ON )
|
|||
|
||||
# Global setting: Use C++14
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Enable additional valgrind instrumentation for stack tracking in libcontext
|
||||
|
@ -853,6 +854,12 @@ if( KICAD_SCRIPTING_WXPYTHON AND NOT KICAD_SCRIPTING_WXPYTHON_PHOENIX )
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if( MINGW AND ( ${wxWidgets_VERSION_STRING} VERSION_LESS 3.1 ) )
|
||||
# Work around a bug in wx < 3.1 -- when wx itself is compiled with
|
||||
# compiler extensions enabled, it assumes these are also available for
|
||||
# applications.
|
||||
add_definitions( -U__STRICT_ANSI__ )
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
# Remove app bundles in ${KICAD_BIN} before installing anything new.
|
||||
|
|
Loading…
Reference in New Issue