=head1 Name

SPVM::Document::EnvironmentVariables - SPVM Environment Variables

=head1 Description

This document explains SPVM environment variables.

=head1 Environment Variables

=head2 SPVM_BUILD_DIR

A directory for files generated by the compiler and linker.

C source codes for precompilation, dynamic link libraries and object files are stored into this directory.

These files are output when attempting to build a module containing methods with the C<native> attribute or the C<precompile> attribute.

If the C<SPVM_BUILD_DIR> environment variable is a non-empty string, these files are output to the directory. If the directory does not exist, an exception is thrown.

If the C<SPVM_BUILD_DIR> environment variable is not spacified, a temporary directory is created at the beginning of the program, and the path is set to the environment variable.

Examples:

  # bash
  export SPVM_BUILD_DIR=~/.spvm_build
  
  # csh
  setenv SPVM_BUILD_DIR ~/.spvm_build

=head2 SPVM_FORCE_BUILD

If it is a true value, compilations and links are forced.

=head2 SPVM_FORCE_QUIET

If it is a non-empty string and a true value, no diagnostic messages from compilers and linkers are printed.

If it is a non-empty string and a false value of Perl, diagnostic messages from compilers and linkers are printed.

This setting has a higher priority than L<SPVM::Builder::Config#quiet|SPVM::Builder::Config/"quiet"> field.

=head2 SPVM_FORCE_OPTIMIZE

If it is a non-empty string, the value is used as a compiler flag for optimaization.

This setting has a higher priority than L<SPVM::Builder::Config#optimize|SPVM::Builder::Config/"optimize"> field.

=head2 SPVM_DEPENDENT_FILE_EXCLUDE_EXTS

A list of file extensions to be excluded from dependent file scanning, separated by commas.

Each element should be only an extension (e.g., C<so>), not including a dot (C<.>). Leading and trailing whitespace in each element is ignored.

These extensions are used to filter out files during the build process, such as large binary files that should not be tracked for changes.

Examples:

  # bash
  export SPVM_DEPENDENT_FILE_EXCLUDE_EXTS=so,obj,exe
  
  # csh
  setenv SPVM_DEPENDENT_FILE_EXCLUDE_EXTS "so, obj, exe"

=head1 See Also

=over 2

=item * L<SPVM::Document>

=back

=head1 Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License
