@@ -550,7 +550,12 @@ compile <- function(quiet = TRUE,
550
550
stanc_built_options <- c(stanc_built_options , paste0(" --" , option_name , " =" , " '" , stanc_options [[i ]], " '" ))
551
551
}
552
552
}
553
- stancflags_val <- paste0(" STANCFLAGS += " , stancflags_val , paste0(" " , stanc_built_options , collapse = " " ))
553
+ make_local_stancflags <- get_make_variable(" STANCFLAGS" )
554
+ stancflags_val <- paste0(
555
+ " STANCFLAGS += " ,
556
+ stancflags_val ,
557
+ paste0(c(" " , stanc_built_options , make_local_stancflags ), collapse = " " )
558
+ )
554
559
withr :: with_path(
555
560
c(
556
561
toolchain_PATH_env_var(),
@@ -769,7 +774,12 @@ check_syntax <- function(pedantic = FALSE,
769
774
),
770
775
run_log <- wsl_compatible_run(
771
776
command = stanc_cmd(),
772
- args = c(wsl_safe_path(self $ stan_file()), stanc_built_options , stancflags_val ),
777
+ args = c(
778
+ wsl_safe_path(self $ stan_file()),
779
+ stanc_built_options ,
780
+ stancflags_val ,
781
+ get_make_variable(" STANCFLAGS" )
782
+ ),
773
783
wd = cmdstan_path(),
774
784
echo = is_verbose_mode(),
775
785
echo_cmd = is_verbose_mode(),
@@ -909,8 +919,12 @@ format <- function(overwrite_file = FALSE,
909
919
),
910
920
run_log <- wsl_compatible_run(
911
921
command = stanc_cmd(),
912
- args = c(wsl_safe_path(self $ stan_file()), stanc_built_options ,
913
- stancflags_val ),
922
+ args = c(
923
+ wsl_safe_path(self $ stan_file()),
924
+ stanc_built_options ,
925
+ stancflags_val ,
926
+ get_make_variable(" STANCFLAGS" )
927
+ ),
914
928
wd = cmdstan_path(),
915
929
echo = is_verbose_mode(),
916
930
echo_cmd = is_verbose_mode(),
0 commit comments