Re: Removing compiler flag from CMake output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> How do I remove that compiler flag from CMake output?
>
> I already tried adding -frtti to CXXFLAGS in makepkg.conf, but this
> didn't change the compiler flags. I also tried to add it as an
> environment variable to the cmake call in PKGBUILD and add a
>
> set(CMAKE_CXX_FLAGS "-frtti")

That isn't a good idea that overwrites CMAKE_CXX_FLAGS entirely rather
than appending.

Regardless of that there are several ways of specifying flags. It can
be done at the target level (e.g. target_compile_definitions(mylib
COMPILE_OPTIONS ...) ) or globally using CMAKE_CXX_FLAGS_*. There are
several flags for different release types, e.g.

CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_RELEASE
CMAKE_CXX_FLAGS

I believe there are other ways to set flags as well. You should look
at how the developers have set their flags in their CMakeLists.txt
files and do it the same way.

As a hack you could check what's set the CMake cache and manually change it

$ make edit_cache

HTH


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux