Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
akrisiun committed Sep 8, 2019
1 parent 29ff994 commit 59edb3f
Show file tree
Hide file tree
Showing 416 changed files with 205,350 additions and 134 deletions.

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if(WIN32)
add_subdirectory(hosts)
endif(WIN32)

128 changes: 128 additions & 0 deletions coreclr/applydefines.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#!/usr/bin/env perl

use strict;

my $sourceFile;
my $outputFile="";
my $definesFile="";

#parse arguments

if (@ARGV == 0)
{
Usage();
}

my %Defines;

# parse args

while (@ARGV)
{
my $nextArg=shift;
if($nextArg eq '-s')
{
NeedNextArg($nextArg, 'file name');
$sourceFile=shift;
}
elsif ($nextArg eq '-o')
{
NeedNextArg($nextArg, 'file name');
$outputFile=shift;
}
elsif ($nextArg eq '-f')
{
NeedNextArg($nextArg, 'file name');
$definesFile=shift;
}
elsif ($nextArg eq '-d')
{
NeedNextArg($nextArg, 'value');
my $customDefine=shift;
if ( $customDefine=~m/^\"?(\S+)=(\S*)\"?$/ )
{
$Defines{$1}=$2;
}
else
{
print "-d expects name=value\n";
Usage();
}
}
elsif ($nextArg eq '-h')
{
Usage();
}
else
{
print "Unknown argument '$nextArg'\n";
Usage();
}
}

# check if we have what we need

if ($sourceFile eq "" || $outputFile eq "" || $definesFile eq "")
{
Usage();
}

open (SOURCEFILE,$sourceFile) or die "Cannot open $sourceFile for reading\n";
open (DEFINESFILE,$definesFile) or die "Cannot open $definesFile for reading\n";
open (OUTPUTFILE,"> $outputFile") or die "Cannot open $outputFile for writing\n";

#load defines

while (<DEFINESFILE>)
{
chomp;
if (/^\s*#define\s+(\S+)\s+(\S*)\s*$/)
{
if (defined $2)
{
$Defines{$1}=$2;
}
else
{
$Defines{$1}="";
}
}
}

while (<SOURCEFILE>)
{
my $string=$_;
my $processed="";
while ($string=~m/\$\(([^)]+)\)/)
{
if (! defined $Defines{$1})
{
die "'$1' is not defined.\n";
}
$string=~s/\$\(([^)]+)\)/$Defines{$1}/;
}
print OUTPUTFILE $string ;
}


# functions
sub Usage()
{
print "Usage: applydefines [options]\n";
print "\t-s <file>\t: the source file to process\n";
print "\t-f <file>\t: the file containing #define settings\n";
print "\t-o <file>\t: the output file\n";
print "\t-d <name>=<Value>\t: additional define\n";

exit 1;
}

sub NeedNextArg()
{
if (@ARGV == 0)
{
print "'@_[0]' requires @_[1]\n";
Usage();
}
}

14 changes: 14 additions & 0 deletions coreclr/hosts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include_directories(inc)

if(WIN32)
add_subdirectory(corerun)
add_subdirectory(coreconsole)
add_subdirectory(coreshim)
else(WIN32)
add_subdirectory(unixcoreruncommon)
add_subdirectory(unixcorerun)
add_subdirectory(unixcoreconsole)
if(CLR_CMAKE_PLATFORM_DARWIN)
add_subdirectory(osxbundlerun)
endif(CLR_CMAKE_PLATFORM_DARWIN)
endif(WIN32)
33 changes: 33 additions & 0 deletions coreclr/hosts/coreconsole/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
project(CoreConsole)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CoreConsole_SOURCES coreconsole.cpp logger.cpp)
set(CoreConsole_RESOURCES native.rc)

add_definitions(-DFX_VER_INTERNALNAME_STR=CoreConsole.exe)

if(CLR_CMAKE_PLATFORM_UNIX)
# This does not compile on Linux yet
if(CAN_BE_COMPILED_ON_LINUX)
_add_executable(CoreConsole
${CoreConsole_SOURCES}
${CoreConsole_RESOURCES}
)
endif(CAN_BE_COMPILED_ON_LINUX)

else()
_add_executable(CoreConsole
${CoreConsole_SOURCES}
${CoreConsole_RESOURCES}
)

target_link_libraries(CoreConsole
${STATIC_MT_CRT_LIB}
${STATIC_MT_VCRT_LIB}
)

# Can't compile on linux yet so only add for windows
install_clr(CoreConsole)

endif(CLR_CMAKE_PLATFORM_UNIX)
Loading

0 comments on commit 59edb3f

Please sign in to comment.