@@ -199,7 +199,7 @@ private static void writeApkVerifierFile(String packageName, File source, ApkVer
199199 }
200200 }
201201
202- public static void writeCmakeFile (File cmakeTemp , String libName ) throws IOException {
202+ public static void writeCmakeFile (File cmakeTemp , String libNmmpName , String libVmName ) throws IOException {
203203 final BufferedReader bufferedReader = new BufferedReader (new InputStreamReader (
204204 new FileInputStream (cmakeTemp ), StandardCharsets .UTF_8 ));
205205
@@ -208,7 +208,10 @@ public static void writeCmakeFile(File cmakeTemp, String libName) throws IOExcep
208208 String libNameFormat = "set\\ (LIBNAME_PLACEHOLDER \" %s\" \\ )" ;
209209
210210 //替换原本libname
211- lines = lines .replaceAll (String .format (libNameFormat , "nmmp" ), String .format (libNameFormat , libName ));
211+ lines = lines .replaceAll (String .format (libNameFormat , "nmmp" ), String .format (libNameFormat , libNmmpName ));
212+
213+ libNameFormat = "set\\ (LIBNMMVM_NAME \" nmmvm\" CACHE INTERNAL \" lib nmmvm name\" \\ )" ;
214+ lines = lines .replaceAll (String .format (libNameFormat , "nmmvm" ), String .format (libNameFormat , libVmName ));
212215
213216 try (FileWriter fileWriter = new FileWriter (cmakeTemp )) {
214217 fileWriter .write (lines );
@@ -556,7 +559,7 @@ private void generateCSources(String packageName) throws IOException {
556559 writeApkVerifierFile (packageName , source , apkVerifyCodeGenerator );
557560 } else if (source .getName ().equals ("CMakeLists.txt" )) {
558561 //处理cmake里配置的本地库名
559- writeCmakeFile (source , Prefs .getVmName ());
562+ writeCmakeFile (source , Prefs .getNmmpName (), Prefs . getVmName ());
560563 }
561564 }
562565 }
0 commit comments