aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-13 03:51:54 +0000
committer_ov4 <ov4@ov4.org>2026-10-13 03:51:54 +0000
commitba1b65f4a20566405c53d4ded90b483ec9aa7d09 (patch)
tree4524a14d5398a3d46be188b30f672b808419f1b4 /CMakeLists.txt
parentf0780bf173ddfdb7ebbf2c7cd2ffd2e447379a65 (diff)
feat: require explicit execution mode and gate external running
Require PATH or NONE at configure time. Reject -r before writing output when lli is unavailable or execution is disabled. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e63860b..b2cead4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.13)
project(cps_compiler)
+set(CPSC_RUN_MODE "" CACHE STRING "Execution mode: PATH or NONE (required)")
+set_property(CACHE CPSC_RUN_MODE PROPERTY STRINGS PATH NONE)
+if(NOT CPSC_RUN_MODE MATCHES "^(PATH|NONE)$")
+ message(FATAL_ERROR "Specify -DCPSC_RUN_MODE=PATH or -DCPSC_RUN_MODE=NONE")
+endif()
+
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
@@ -33,9 +39,10 @@ add_library(CPSCodeGen
lib/CodeGen/FileHandler.cc
)
-llvm_map_components_to_libnames(llvm_libs core support native irreader)
+llvm_map_components_to_libnames(llvm_libs core support)
add_executable(cpsc tools/driver/main.cc)
+target_compile_definitions(cpsc PRIVATE CPSC_RUN_${CPSC_RUN_MODE})
target_link_libraries(cpsc
CPSCodeGen
CPSParser