mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
third-party: build all deps with debugging symbols (#8042)
When building with CMAKE_BUILD_TYPE=Debug, the dependencies are built like this: | Dep | Defaults | Debug | |------------|-----------|---------------------------------------------| | unibilium | `-O2` | `make CFLAGS=-O0 DEBUG=1` | | msgpack | `-g -O3` | `cmake . -DCMAKE_C_FLAGS_DEBUG="-O0 -ggdb"` | | libuv | `-g -O2` | `./configure CFLAGS="-O0 -ggdb"` | | luv | `-g -O2` | `cmake . -DCMAKE_C_FLAGS_DEBUG="-O0 -ggdb"` | | libvterm | not set | `make CFLAGS=-O0 DEBUG=1` | | libtermkey | not set | `make CFLAGS=-O0 DEBUG=1` | | jemalloc | `-g3 -O3` | `./configure CFLAGS="-O0 -ggdb"` | | gperf | `-g -O2` | `./configure CXXFLAGS="-O0 -ggdb"` | | luajit | `-g -O2` | haven't checked yet | This means that only unibilium, libtermkey, and libvterm don't build with debugging symbols by default. Build them with debugging symbols and optimisations that don't hinder debugging: -Og -g
This commit is contained in:
10
third-party/CMakeLists.txt
vendored
10
third-party/CMakeLists.txt
vendored
@@ -2,6 +2,9 @@
|
||||
cmake_minimum_required (VERSION 2.8.7)
|
||||
project(NVIM_DEPS)
|
||||
|
||||
# Needed for: check_c_compiler_flag()
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
# Point CMake at any custom modules we may ship
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
@@ -11,6 +14,13 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-g)
|
||||
|
||||
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
||||
if(HAS_OG_FLAG)
|
||||
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
|
||||
endif()
|
||||
|
||||
set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/usr" CACHE PATH "Dependencies install directory.")
|
||||
set(DEPS_BIN_DIR "${DEPS_INSTALL_DIR}/bin" CACHE PATH "Dependencies binary install directory.")
|
||||
set(DEPS_LIB_DIR "${DEPS_INSTALL_DIR}/lib" CACHE PATH "Dependencies library install directory.")
|
||||
|
||||
Reference in New Issue
Block a user