Skip to content

Commit

Permalink
[JVM] Make osname available in nqp::backendconfig
Browse files Browse the repository at this point in the history
This key is available on the other backends, and there are a couple
of special cases in Rakudo's code base because the operating system
name had to be taken from nqp::jvmgetproperties(){'os.name'}.
  • Loading branch information
usev6 committed Jul 27, 2020
1 parent b94f860 commit f0cfdf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/HLL/Compiler.nqp
Expand Up @@ -817,13 +817,12 @@ class HLL::Compiler does HLL::Backend::Default {
method nqp-home() {
if !$!nqp-home {
# Determine NQP directory
my $config := nqp::backendconfig();
my $sep := $config<osname> eq 'MSWin32' ?? '\\' !! '/';
#?if jvm
my $sep := nqp::atkey(nqp::jvmgetproperties,'os.name') eq 'MSWin32' ?? '\\' !! '/';
my $execname := nqp::atkey(nqp::jvmgetproperties,'nqp.execname') // '';
#?endif
#?if !jvm
my $config := nqp::backendconfig();
my $sep := $config<osname> eq 'MSWin32' ?? '\\' !! '/';
my $execname := nqp::execname();
#?endif
my $install-dir := $execname eq ''
Expand Down
1 change: 1 addition & 0 deletions tools/build/gen-jvm-properties.pl
Expand Up @@ -53,4 +53,5 @@
nativecall.lddlflags=$Config{lddlflags}
nativecall.libs=$Config{libs}
nativecall.perllibs=$Config{perllibs}
osname=$^O
END

0 comments on commit f0cfdf2

Please sign in to comment.