简体   繁体   中英

Configure OSX Clang to be case sensitive to include statements

I know that case sensitivity in C++ include statements is a file system issue (related questions here and here ).

Is it possible to configure Clang to require case sensitive matches to prevent cross platform build issues?

Clang now has these warning flags:

-Wnonportable-include-path
-Wnonportable-system-include-path

The first is for quoted includes and the second is for angle bracket includes. They can even be mapped to errors:

-Werror=nonportable-include-path
-Werror=nonportable-system-include-path

Presumably, they're not enabled by default because they can slow down the compile. I haven't taken the time to investigate just how much.

Well, as you stated, and as those questions stated, it's a file system issue. If you formatted your OS X drive as case-sensitive, then it might work, but really you should probably find a different way of differentiating headers.

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