CMake: Error out if source directory if src/ instead of top-level dir

This commit is contained in:
Alexander Babikov
2025-07-31 01:57:36 +05:00
parent 37481032ed
commit c76a682069
2 changed files with 7 additions and 1 deletions

View File

@@ -221,7 +221,7 @@ if(NOT EMU_BUILD_NUM)
set(EMU_BUILD_NUM 0)
endif()
if(NOT EMU_COPYRIGHT_YEAR)
set(EMU_COPYRIGHT_YEAR 2024)
set(EMU_COPYRIGHT_YEAR 2025)
endif()
# Libasan
@@ -230,4 +230,6 @@ if(LIBASAN)
add_link_options(-fsanitize=address)
endif()
set(CMAKE_TOP_LEVEL_PROCESSED TRUE)
add_subdirectory(src)

View File

@@ -16,6 +16,10 @@
# Copyright 2024 Jasmine Iwanek.
#
if(NOT CMAKE_TOP_LEVEL_PROCESSED)
message(FATAL_ERROR "Incorrect source directory specified. Delete your build directory and retry with the top-level directory instead")
endif()
if(APPLE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()