2020import android .support .annotation .Nullable ;
2121
2222import com .duy .ccppcompiler .compiler .ICompileSetting ;
23- import com .duy .ccppcompiler .compiler .shell .CommandBuilder ;
24- import com .duy .ccppcompiler .compiler .shell .CommandResult ;
2523import com .duy .ccppcompiler .compiler .result .CompileResult ;
2624import com .duy .ccppcompiler .compiler .result .NativeActivityCompileResult ;
27- import com .duy .ccppcompiler .compiler .result .SDLCompileResult ;
25+ import com .duy .ccppcompiler .compiler .shell .CommandBuilder ;
26+ import com .duy .ccppcompiler .compiler .shell .CommandResult ;
2827import com .duy .ccppcompiler .packagemanager .Environment ;
2928import com .duy .common .DLog ;
3029
@@ -41,14 +40,12 @@ public class GCCCompiler extends CompilerImpl {
4140 protected final ICompileSetting mSetting ;
4241
4342 protected final boolean mBuildNativeActivity ;
44- protected final boolean mBuildSDL ;
4543
4644 File mOutFile ;
4745
48- public GCCCompiler (Context context , boolean nativeActivity , boolean buildSDL , @ Nullable ICompileSetting setting ) {
46+ public GCCCompiler (Context context , boolean nativeActivity , @ Nullable ICompileSetting setting ) {
4947 super (context );
5048 mBuildNativeActivity = nativeActivity ;
51- mBuildSDL = buildSDL ;
5249 mSetting = setting ;
5350 }
5451
@@ -59,8 +56,6 @@ public CompileResult compile(File[] sourceFiles) {
5956 CompileResult result ;
6057 if (mBuildNativeActivity ) {
6158 result = new NativeActivityCompileResult (shellResult );
62- } else if (mBuildSDL ) {
63- result = new SDLCompileResult (shellResult );
6459 } else {
6560 result = new CompileResult (shellResult );
6661 }
@@ -85,8 +80,6 @@ protected String buildArgs(File[] sourceFiles) {
8580
8681 if (mBuildNativeActivity ) {
8782 args .addFlags (buildNativeActivityFlags (sourceFiles ));
88- } else if (mBuildSDL ) {
89- args .addFlags (buildSDLActivityFlags (sourceFiles ));
9083 } else {
9184 args .addFlags (buildExecutableFlags (sourceFiles ));
9285 }
@@ -99,28 +92,6 @@ protected String buildArgs(File[] sourceFiles) {
9992 return args .build ();
10093 }
10194
102- protected ArrayList <String > buildSDLActivityFlags (File [] sourceFiles ) {
103- File source = sourceFiles [0 ];
104- String nameNoExt = source .getName ().substring (0 , source .getName ().lastIndexOf ("." ));
105-
106- if (DLog .DEBUG ) DLog .d (TAG , "buildArgs: build native activity" );
107- String soName = "lib" + nameNoExt + ".so" ;
108- mOutFile = new File (source .getParent (), soName );
109- String cctools = Environment .getCCtoolsDir (mContext );
110- CommandBuilder flags = new CommandBuilder ();
111-
112- //default flags
113- flags .addFlags ("-DANDROID" )
114- .addFlags ("-I" + new File (Environment .getSdCardHomeDir (), "SDL/include" ).getAbsolutePath ())
115- //ld flags
116- .addFlags ("-shared" )
117- .addFlags (new File (Environment .getSdCardHomeDir (), "SDL/lib/SDL_android_main.o" ).getAbsolutePath ())
118- .addFlags ("-I" + new File (Environment .getSdCardHomeDir (), "SDL/lib" ).getAbsolutePath ())
119- .addFlags ("-o" , mOutFile .getAbsolutePath ());
120-
121- return flags .toList ();
122- }
123-
12495 protected ArrayList <String > buildExecutableFlags (File [] sourceFiles ) {
12596 File source = sourceFiles [0 ];
12697 String nameNoExt = source .getName ().substring (0 , source .getName ().lastIndexOf ("." ));
0 commit comments