Skip to content

Commit 3e16c6b

Browse files
committed
Adjusts llvm up missing commands
1 parent f5be3fb commit 3e16c6b

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

llvmup

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ SET_DEFAULT=0
3838
PROFILE=""
3939
COMPONENTS=()
4040
DISABLE_LIBC_WNO_ERROR=0
41+
RECONFIGURE=0
4142

4243
# Logging functions
4344
log_verbose() {
@@ -74,7 +75,7 @@ handle_config_command() {
7475

7576
if [ -z "$sub_command" ]; then
7677
log_error "Missing config subcommand"
77-
log_info "Available subcommands: init, load, activate"
78+
log_info "Available subcommands: init, load, apply, activate"
7879
exit 1
7980
fi
8081

@@ -111,9 +112,19 @@ handle_config_command() {
111112
exit 1
112113
fi
113114
;;
115+
apply)
116+
# Call llvm-config-apply function
117+
if command -v llvm-config-apply >/dev/null 2>&1; then
118+
llvm-config-apply "$@"
119+
else
120+
log_error "llvm-config-apply function not available"
121+
log_info "Make sure LLVM functions are loaded in your shell"
122+
exit 1
123+
fi
124+
;;
114125
*)
115126
log_error "Unknown config subcommand: $sub_command"
116-
log_info "Available subcommands: init, load, activate"
127+
log_info "Available subcommands: init, load, apply, activate"
117128
exit 1
118129
;;
119130
esac
@@ -240,6 +251,7 @@ Install Options:
240251
-p, --profile <PROFILE> Build profile: minimal, full, custom
241252
--component <COMPONENT> Install specific components (can be repeated)
242253
--disable-libc-wno-error Disable LIBC_WNO_ERROR=ON flag
254+
--reconfigure Force CMake to reconfigure the build (removes CMakeCache.txt)
243255
-v, --verbose Enable verbose output for debugging
244256
-q, --quiet Suppress non-essential output
245257
-h, --help Show this help message
@@ -257,6 +269,8 @@ Examples:
257269
llvmup default set 18.1.8 # Set default version
258270
llvmup default show # Show current default
259271
llvmup config init # Initialize project config
272+
llvmup config load # Load and display config
273+
llvmup config apply # Install using config settings
260274
llvmup config activate # Activate from config
261275
EOF
262276
exit "$exit_code"
@@ -359,6 +373,11 @@ while [[ $# -gt 0 ]]; do
359373
log_verbose "Option: LIBC_WNO_ERROR flag disabled"
360374
shift
361375
;;
376+
--reconfigure)
377+
RECONFIGURE=1
378+
log_verbose "Option: Force CMake reconfiguration enabled"
379+
shift
380+
;;
362381
-v|--verbose)
363382
VERBOSE=1
364383
log_verbose "Option: Verbose output enabled"
@@ -432,6 +451,11 @@ if [ "$DISABLE_LIBC_WNO_ERROR" -eq 1 ]; then
432451
script_args+=("--disable-libc-wno-error")
433452
fi
434453

454+
# Add reconfigure flag
455+
if [ "$RECONFIGURE" -eq 1 ]; then
456+
script_args+=("--reconfigure")
457+
fi
458+
435459
# Add remaining arguments (version, etc.)
436460
script_args+=("${remaining_args[@]}")
437461

0 commit comments

Comments
 (0)