Skip to content

Commit ae0ebc9

Browse files
committed
CMake: prefer the vendored simdjson include path
On macOS, locating DevIL via Homebrew brings /opt/homebrew/include onto the global include path. A Homebrew-installed simdjson there can shadow our vendored, version-matched copy in rts/lib/simdjson/include and break the build (a newer simdjson trips an AppleClang macro collision). Add BEFORE to the include_directories() call so the vendored simdjson path always leads the include search and <simdjson.h> resolves in-tree on every platform. This only reorders the vendored dir to the front and is a no-op where no Homebrew simdjson is present. Source: ExaDev/RecoilEngine 806d539.
1 parent 7e07543 commit ae0ebc9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

rts/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ make_global_var(engineSources
142142
${sources_engine_ExternalAI}
143143
)
144144
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib/assimp/include) #FIXME: hack for rts/Rendering/Models/IModelParser.cpp
145-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib/simdjson/include)
145+
# On macOS, locating DevIL via Homebrew pulls /opt/homebrew/include onto the
146+
# global include path, where a transitively-installed Homebrew simdjson.h can
147+
# shadow our vendored, version-matched copy and break the build (newer simdjson
148+
# trips an AppleClang macro collision). Prepend so <simdjson.h> always resolves
149+
# to the in-tree version on every platform.
150+
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/lib/simdjson/include)
146151
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib/fastgltf/include)
147152

148153
### Add headers for generated project files (e.g. Code::Blocks)

0 commit comments

Comments
 (0)