I'm having a problem with cmake / gcc / Linux.
No matter what I try, I cannot get rid of CMAKE_CXX_FLAGS on my linker line. CMake keeps passing them when invoking g++ in link mode.
I have -fopenmp in my CMAKE_CXX_FLAGS and it must not be present on the link line so g++ doesn't link to gomp (I'm using Intel's iomp5 instead).
Edit: I tried the following the beginning of CMakeLists.txt, didn't help:
set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
Thanks
Turns out
add_compile_options("-fopenmp")
avoids adding these options to the linker. It doesn't solve the general issue of CMAKE_CXX_FLAGS showing up in the linker line, but it solves the immediate problem I have.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With