mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
nanodbc: Remove extra CXX flags from the build
nanodbc was overriding the C++ standard library being used, which would break builds with clang. Additionally, adding Werror unconditionally in production code is a bad idea because different compiler versions can change/add warnings and then break the code.
This commit is contained in:
parent
201b45b41a
commit
69a6ddae03
15
thirdparty/nanodbc/CMakeLists.txt
vendored
15
thirdparty/nanodbc/CMakeLists.txt
vendored
@ -26,20 +26,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
message(STATUS "nanodbc compile: C++${CMAKE_CXX_STANDARD}")
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wnarrowing -Werror")
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
if(NOT NANODBC_DISABLE_LIBCXX)
|
||||
check_cxx_compiler_flag("-stdlib=libc++" CXX_SUPPORTS_STDLIB)
|
||||
if(CXX_SUPPORTS_STDLIB)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -stdlib=libc++")
|
||||
endif()
|
||||
set(NANODBC_DISABLE_LIBCXX ${NANODBC_DISABLE_LIBCXX} CACHE BOOL "Do not use libc++, if available." FORCE)
|
||||
endif()
|
||||
message(STATUS "nanodbc build: Disable linking libc++ - ${NANODBC_DISABLE_LIBCXX}")
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
string(REGEX REPLACE "[/-]W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
if (NOT (CMAKE_VERSION VERSION_LESS 3.6.0)) # Compiler features for Intel in CMake 3.6+
|
||||
@ -202,4 +189,4 @@ endif()
|
||||
if(NANODBC_ENABLE_UNICODE)
|
||||
add_compile_definitions(NANODBC_ENABLE_UNICODE)
|
||||
target_compile_definitions(nanodbc PUBLIC NANODBC_ENABLE_UNICODE)
|
||||
endif()
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user