Skip to content

Commit

Permalink
Disallow in-source build to prevent issues
Browse files Browse the repository at this point in the history
  • Loading branch information
facuMH committed Apr 24, 2023
1 parent 0685d94 commit ec0e0ce
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ if(CXX_COMPILER_IS_DPCPP)
message(STATUS "CXX compiler at ${CMAKE_CXX_COMPILER} detected as DPC++")
endif()

if ((CMAKE_CURRENT_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) OR
(CMAKE_CURRENT_BINARY_DIR STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/src) OR
(CMAKE_CURRENT_BINARY_DIR STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/include) OR
(CMAKE_CURRENT_BINARY_DIR STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/test) OR
(CMAKE_CURRENT_BINARY_DIR STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/examples) OR
(CMAKE_CURRENT_BINARY_DIR STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/vendor) OR
(CMAKE_CURRENT_BINARY_DIR STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/website))
message(FATAL_ERROR "Building in root or relevant directories will cause troubles.\nPLEASE use a build directory.")
else()
message(STATUS "Build Dir is ${CMAKE_CURRENT_BINARY_DIR}")
endif()

# Find SYCL implementation.
set(hipSYCL_MIN_VERSION "0.9.1")
if(CELERITY_SYCL_IMPL STREQUAL "hipSYCL")
Expand Down

0 comments on commit ec0e0ce

Please sign in to comment.