mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-01 20:00:51 -05:00
Order SYSTEM include directories after non-system directories
An effect of the `-isystem` flag is to search the directory after those specified via `-I` flags. Make behavior more consistent on compilers that do not have any `-isystem` flag by explicitly moving system include directories to the end.
This commit is contained in:
@@ -65,6 +65,10 @@ else()
|
||||
PROPERTIES COMPILE_FLAGS "-ITarProp")
|
||||
endif()
|
||||
|
||||
add_library(ordertest ordertest.cpp)
|
||||
target_include_directories(ordertest SYSTEM PUBLIC SystemIncludeDirectories/systemlib)
|
||||
target_include_directories(ordertest PUBLIC SystemIncludeDirectories/userlib)
|
||||
|
||||
add_subdirectory(StandardIncludeDirectories)
|
||||
add_subdirectory(TargetIncludeDirectories)
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#error ordertest.h includes from systemlib
|
||||
@@ -0,0 +1 @@
|
||||
/* empty file */
|
||||
@@ -0,0 +1 @@
|
||||
#include "ordertest.h"
|
||||
Reference in New Issue
Block a user