summaryrefslogtreecommitdiff
path: root/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/buildtools/third_party/libc++/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake')
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake
new file mode 100644
index 00000000000..a0669365bf9
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake
@@ -0,0 +1,18 @@
+# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
+
+macro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage )
+
+string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource )
+if( _insource )
+ message( SEND_ERROR "${_errorMessage}" )
+ message( FATAL_ERROR
+ "In-source builds are not allowed.
+ CMake would overwrite the makefiles distributed with Compiler-RT.
+ Please create a directory and run cmake from there, passing the path
+ to this source directory as the last argument.
+ This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
+ Please delete them."
+ )
+endif( _insource )
+
+endmacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD )