mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
build: set CMAKE_C_STANDARD to 99 for all dependencies
Older gcc versions (4.x) require passing --std=c99 compiler flag to prevent warnings from being emitted. Instead of setting it for each dependency, it's easier to just pass the CMAKE_C_STANDARD flag to all dependencies. This also prevents the scenario of us forgetting to set it if we add new dependencies.
This commit is contained in:
parent
a478fd4175
commit
b155608bff
@ -14,6 +14,7 @@ include(Util)
|
||||
|
||||
set(DEPS_CMAKE_ARGS
|
||||
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-D CMAKE_C_STANDARD=99
|
||||
-D CMAKE_GENERATOR=${CMAKE_GENERATOR}
|
||||
-D CMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
||||
-D CMAKE_POSITION_INDEPENDENT_CODE=ON)
|
||||
|
@ -5,8 +5,6 @@ include(GNUInstallDirs)
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
else()
|
||||
add_compile_options(-std=c99)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||
|
@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(tree-sitter C)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
add_library(tree-sitter lib/src/lib.c)
|
||||
target_include_directories(tree-sitter
|
||||
PRIVATE lib/src lib/include)
|
||||
|
@ -1,7 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(parser C)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
file(GLOB source_files src/*.c)
|
||||
|
||||
add_library(parser
|
||||
|
@ -3,9 +3,6 @@ project(libtermkey C)
|
||||
|
||||
add_definitions(-D _CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions(-DHAVE_UNIBILIUM)
|
||||
if(NOT MSVC)
|
||||
add_compile_options(-std=c99)
|
||||
endif()
|
||||
|
||||
include_directories(${PROJECT_BINARY_DIR}/t)
|
||||
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
||||
|
Loading…
Reference in New Issue
Block a user