1*58b9f456SAndroid Build Coastguard Worker# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>) 2*58b9f456SAndroid Build Coastguard Worker 3*58b9f456SAndroid Build Coastguard Workermacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage ) 4*58b9f456SAndroid Build Coastguard Worker 5*58b9f456SAndroid Build Coastguard Workerstring( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource ) 6*58b9f456SAndroid Build Coastguard Workerif( _insource ) 7*58b9f456SAndroid Build Coastguard Worker message( SEND_ERROR "${_errorMessage}" ) 8*58b9f456SAndroid Build Coastguard Worker message( FATAL_ERROR 9*58b9f456SAndroid Build Coastguard Worker "In-source builds are not allowed. 10*58b9f456SAndroid Build Coastguard Worker CMake would overwrite the makefiles distributed with Compiler-RT. 11*58b9f456SAndroid Build Coastguard Worker Please create a directory and run cmake from there, passing the path 12*58b9f456SAndroid Build Coastguard Worker to this source directory as the last argument. 13*58b9f456SAndroid Build Coastguard Worker This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. 14*58b9f456SAndroid Build Coastguard Worker Please delete them." 15*58b9f456SAndroid Build Coastguard Worker ) 16*58b9f456SAndroid Build Coastguard Workerendif( _insource ) 17*58b9f456SAndroid Build Coastguard Worker 18*58b9f456SAndroid Build Coastguard Workerendmacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD ) 19