Skip to content

Commit ce59d76

Browse files
committed
disallow in-tree builds
CMake recommends against in-tree builds, most other projects like LLVM disable this support as well. Performing a configure in the tree can cause spurious files to be generated which can break the build. Simply prevent the user from doing so.
1 parent 1846a59 commit ce59d76

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ endif()
1111
list(APPEND CMAKE_MODULE_PATH
1212
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
1313

14+
set(CMAKE_DISABLE_IN_SOURCE_BUILD YES)
15+
1416
if(DEFINED CMAKE_JOB_POOLS)
1517
# CMake < 3.11 doesn't support CMAKE_JOB_POOLS. Manually set the property.
1618
set_property(GLOBAL PROPERTY JOB_POOLS "${CMAKE_JOB_POOLS}")

0 commit comments

Comments
 (0)