简体   繁体   中英

CMake: how to get compiler “system” flags?

I'm trying to print using message all the compiler flags passed to my targets (they are the same for all targets). (Why? I need to pass them to cldoc to generate documentation using clang...).

Under MacOs I realize when doing make VERBOSE=1 that the following flags are passed to clang:

-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9

What is the CMake variable that gives me these in a portable way?

Note: AFAIK they are not in: CMAKE_CXX_FLAGS , CMAKE_CXX_COMPILE_FLAGS , CMAKE_CXX_LINK_FLAGS , CMAKE_EXE_LINKER_FLAGS , CMAKE_CXX_FLAGS_RELEASE/DEBUG , CMAKE_C_FLAGS , CMAKE_C_COMPILE_FLAGS , CMAKE_C_LINK_FLAGS .

In my project I just use additional definition in my head CMakeList.txt with the "-v" command: add_definitions(-v)

Is similar to add VERBOSE=1 to the make command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM