2

I have

set(CMAKE_CXX_FLAGS_RELEASE "-O3 -m64 -march=native -flto")

but I'd like to remove -flto for a specific target compilation:

file(GLOB TST_SOURCES "${CMAKE_SOURCE_DIR}/x64_test/*.cpp")
add_executable(_x64_test ${TST_SOURCES})
target_compile_options(_x64_test PRIVATE -Wall -DLITTLE_ENDIAN)
target_link_libraries(_x64_test PRIVATE test_iface pthread m)

Is it possible?

GinoC
  • 442
  • 4
  • 16
  • just `-fno-lto` ? Using `target_set_property(... INTEPR OCEDURAL_OPTIMIZATION ON)` is preferred – KamilCuk Jul 06 '20 at 09:24
  • Yes, in this case you're right! I could deactivate lto optimization using no-lto flag. But in general, is it possible to remove or change a flag? – GinoC Jul 06 '20 at 09:30

0 Answers0