Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: platform_tools/android/launcher/skia_launcher.cpp

Issue 1898793004: Cleanup android build files and tools (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « platform_tools/android/gyp/dependencies.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return -1; 60 return -1;
61 } 61 }
62 62
63 // attempt to lookup the location of the skia app 63 // attempt to lookup the location of the skia app
64 const char* appLocation = "/data/local/tmp"; 64 const char* appLocation = "/data/local/tmp";
65 if (!file_exists(appLocation)) { 65 if (!file_exists(appLocation)) {
66 printf("ERROR: Unable to find /data/local/tmp on the device.\n"); 66 printf("ERROR: Unable to find /data/local/tmp on the device.\n");
67 return -1; 67 return -1;
68 } 68 }
69 69
70 void* skiaLibrary;
71
72 #if defined(SKIA_DLL) 70 #if defined(SKIA_DLL)
73 // load the local skia shared library 71 // load the local skia shared library
74 skiaLibrary = load_library(appLocation, "skia_android"); 72 void* skiaLibrary = load_library(appLocation, "skia_android");
75 if (NULL == skiaLibrary) 73 if (NULL == skiaLibrary)
76 { 74 {
77 return -1; 75 return -1;
78 } 76 }
79 #endif 77 #endif
80 78
81 // load the appropriate library 79 // load the appropriate library
82 void* appLibrary = load_library(appLocation, argv[1]); 80 void* appLibrary = load_library(appLocation, argv[1]);
83 if (NULL == appLibrary) { 81 if (NULL == appLibrary) {
84 return -1; 82 return -1;
85 } 83 }
86 84
87 #if !defined(SKIA_DLL)
88 skiaLibrary = appLibrary;
89 #endif
90
91 // find the address of the main function 85 // find the address of the main function
92 int (*app_main)(int, const char**); 86 int (*app_main)(int, const char**);
93 *(void **) (&app_main) = dlsym(appLibrary, "main"); 87 *(void **) (&app_main) = dlsym(appLibrary, "main");
94 88
95 if (!app_main) { 89 if (!app_main) {
96 printf("ERROR: Unable to load the main function of the selected program. \n"); 90 printf("ERROR: Unable to load the main function of the selected program. \n");
97 printf("ERROR: %s\n", dlerror()); 91 printf("ERROR: %s\n", dlerror());
98 return -1; 92 return -1;
99 } 93 }
100 94
101 // pass all additional arguments to the main function 95 // pass all additional arguments to the main function
102 return launch_app(app_main, argc - 1, ++argv); 96 return launch_app(app_main, argc - 1, ++argv);
103 } 97 }
OLDNEW
« no previous file with comments | « platform_tools/android/gyp/dependencies.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698