mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-30 23:03:05 +00:00 
			
		
		
		
	Fix for Clang 16
This commit is contained in:
		| @@ -4,10 +4,24 @@ | ||||
| # SPDX-FileCopyrightText: 2023 C. Fernandez-Prades cfernandez(at)cttc.es | ||||
| # SPDX-License-Identifier: BSD-3-Clause | ||||
|  | ||||
| # Downloads and builds the protoc compiler and static libraries of Protocol | ||||
| # Buffers >= v22.0 (see https://protobuf.dev/) It requires CMake >= 3.10 and the | ||||
| # abseil-cpp >= 20230117 libraries (see https://github.com/abseil/abseil-cpp) | ||||
| # already installed. Zlib is used if found. | ||||
| # | ||||
| # Note: requires the patch command if using GCC >= 13 or Clang >= 16 | ||||
| # | ||||
| # Creates protobuf::libprotobuf and protobuf::protoc imported targets. | ||||
|  | ||||
|  | ||||
| if(NOT GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION) | ||||
|     set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "22.2") | ||||
| endif() | ||||
|  | ||||
| if(NOT GNSSSDR_BINARY_DIR) | ||||
|     set(GNSSSDR_BINARY_DIR "${PROJECT_BINARY_DIR}") | ||||
| endif() | ||||
|  | ||||
| if(NOT ZLIB_FOUND) | ||||
|     find_package(ZLIB) | ||||
|     set_package_properties(ZLIB PROPERTIES | ||||
| @@ -43,9 +57,9 @@ list(APPEND UTF8_LIBRARIES | ||||
|     ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}utf8_range${CMAKE_STATIC_LIBRARY_SUFFIX} | ||||
| ) | ||||
|  | ||||
| # Fix for GCC 13 | ||||
| if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||||
|     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "12.99") | ||||
| # Fix for GCC 13 and Clang 16 | ||||
| if(((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13")) OR | ||||
|   ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16"))) | ||||
|     find_program(Patch_EXECUTABLE NAME patch PATHS ENV PATH) | ||||
|     if(NOT Patch_EXECUTABLE) | ||||
|         message(FATAL_ERROR "The patch command is not found. It is required to build Protocol Buffers. Please check your OS documentation and install the patch command.") | ||||
| @@ -58,9 +72,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||||
|     if(EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/src/google/protobuf/port.h) | ||||
|         set(PROTOBUF_PATCH_COMMAND "") | ||||
|     endif() | ||||
|     else() | ||||
|         set(PROTOBUF_PATCH_COMMAND "") | ||||
|     endif() | ||||
| else() | ||||
|     set(PROTOBUF_PATCH_COMMAND "") | ||||
| endif() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez