rdnetto / YCM-Generator

Generates config files for YouCompleteMe (https://github.com/Valloric/YouCompleteMe)
GNU General Public License v3.0
917 stars 129 forks source link

Cmake flags not showing up when set via CMAKE_CXX_FLAGS #104

Closed IanQS closed 6 years ago

IanQS commented 7 years ago

When I run the generator on the following:


cmake_minimum_required(VERSION 3.1)

SET(CMAKE_CXX_FLAGS "-Wall -pedantic -Wextra")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

it only generates these flags:

flags = [
    '-x',
    'c++',
]

Does anyone know what's up? Or if I'm setting variables incorrectly or something?

rdnetto commented 7 years ago

If it's only generating those flags, then those are the only flags the compiler is receiving. I don't know enough about cmake to help debug this, but maybe setting them in a single line would help?

IanQS commented 7 years ago

Tried that too and it wasn't working unfortunately. The strange thing is that if I use

set (CMAKE_CXX_STANDARD 11)

which should theoretically do the same thing as

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

then it works fine. Which is making me think that it's an issue with CMAKE_CXX_FLAGS?