Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

User-specified compilation flags are ignored #164

@numberZero

Description

@numberZero

set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_DEBUG "-g")

This was probably intended to provide default values for CMAKE_CXX_FLAGS_RELEASE and (for whatever reason) CMAKE_CXX_FLAGS_DEBUG. Instead, it sets regular variables which hide the user-specified (cache) variables with hard-coded values.

E.g. I have this in my CMakeCache:
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
But actual compilation command doesn’t contain -DNDEBUG.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions