Commits

Eberhard Rensch  committed 91872e7

removed preprocessOpenCL.pl from the STLImport subproject (the script is part of the P3DCore.framework)

  • Participants
  • Parent commits 6889790

Comments (0)

Files changed (1)

File ToolPlugins/STLImport/preprocessOpenCL.pl

-#!/usr/bin/perl
-print "$0 v0.5\n";
-print "Processing $ARGV[0]\n";
-
-@searchpath = ($ENV{INPUT_FILE_DIR})
-
-
-open IN, $ARGV[0] or die "Cannot read input file $ARGV[0]: $!\n";
-@inFile = <IN>;
-close IN;
-chomp(@inFile);
-
-@outFiles = ();
-$outFile = "";
-foreach $line (@inFile)
-{
-	if($line =~ /\s*#include\s*("(.*)".*)/)
-	{
-		$line = "/* using $1 */";
-		$includeFileName = $2;
-		$line =~ s/"/\\"/g;
-		$outFile .= "\"".$line."\\n\" \\\n";
-		$includeSource = generateIncludeSource($includeFileName);
-		push(@outFiles, $includeSource);
-	}
-	else
-	{
-		$line =~ s/"/\\"/g;
-		$outFile .= "\"".$line."\\n\" \\\n";
-	}
-}
-push(@outFiles, $outFile);
-
-$outPath = $ENV{DERIVED_FILES_DIR}."/".$ENV{INPUT_FILE_BASE}."OpenCLSource.h";
-open OUT, ">".$outPath or die "Cannot write output file $outPath: $!\n";
-print OUT "const char* $ENV{INPUT_FILE_BASE}SourceCode\[\]=\{\n";
-for($i=0;$i<=$#outFiles;$i++)
-{
-	print OUT $outFiles[$i];
-	if($i==$#outFiles)
-	{
-		print OUT "\};\n";
-	}
-	else
-	{
-		print OUT ",\n";
-	}
-}
-
-print OUT "const cl_uint $ENV{INPUT_FILE_BASE}SourceCodeCount=",($#outFiles+1),";\n";
-close OUT;
-print "Result written to $outPath\n";
-
-exit(0);
-
-sub generateIncludeSource
-{
-	$infileName = shift;
-	$outInclude = "";
-	#$infilePath = $ENV{INPUT_FILE_DIR}."/".$infileName;
-	$infilePath = findAbsoluteSourcePath($infileName);
-	
-	print "Generate include source from $infilePath\n";
-	
-	open INCLUDE, $infilePath or die "Cannot read input file $infilePath: $!\n";
-	@includeFile = <INCLUDE>;
-	close INCLUDE;
-	chomp(@includeFile);
-
-	foreach $line (@includeFile)
-	{
-		$line =~ s/"/\\"/g;
-		$line =~ s/cl_(char|uchar|short|ushort|int|uint|long|ulong|float)(\d{1,2})?/\1\2/g;
-		
-		$outInclude .= "\"".$line."\\n\" \\\n";
-	}
-	
-	return $outInclude;
-}
-
-sub findAbsoluteSourcePath
-{
-	$fileToFind = shift;
-	
-	undef $fullpath;
-	find(\&check, @searchpath);
-	
-	return $fullpath;
-}
-
-sub check
-{
-	$current = $_;
-	if($current=/^$fileToFind$/)
-	{
-		$fullpath = $File::Find::name;
-		$File::Find::prune = 1;
-	}
-}