diff options
Diffstat (limited to 'third-party/CMakeLists.txt')
-rw-r--r-- | third-party/CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index ceebb4cf1d..c523ecea00 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -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.") |