Skip to content

Commit

Permalink
Support static library SAPIs (e.g. embed)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmb69 committed Jan 12, 2025
1 parent 36dbcf9 commit 6dbde78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion win32/build/confutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,8 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
} else {
if (ld) {
MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS_RESP) $(BUILD_DIR)\\$(PHPLIB) $(ARFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
NFO.WriteLine("rule ar_" + sapiname);
NFO.WriteLine(" command = " + "${MAKE_LIB}" + " /nologo /out:${BUILD_DIR}\\" + makefiletarget + " " + ldflags.replace(/\$\(([a-zA-Z0-9_]+)\)/g, "${$1}") + " ${" + SAPI + "_GLOBAL_OBJS_RESP} ${BUILD_DIR}\\${PHPLIB} ${ARFLAGS_" + SAPI + "} ${LIBS_" + SAPI + "} ${BUILD_DIR}\\" + resname);
} else {
ld = CMD_MOD1 + '"$(LINK)"';
MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS_RESP) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
Expand All @@ -1308,7 +1310,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
}

if (!MODE_PHPIZE) {
ninja.globals[SAPI] = "build ${BUILD_DIR}\\" + makefiletarget + ": ld_" + sapiname;
ninja.globals[SAPI] = "build ${BUILD_DIR}\\" + makefiletarget + ": " + (is_lib ? "ar_" : "ld_") + sapiname;
ninja.globals[SAPI] += " " + "${DEPS_" + SAPI + "}";
ninja.globals[SAPI] += " ${" + SAPI + "_GLOBAL_OBJS}";
ninja.globals[SAPI] += " ${BUILD_DIR}\\${PHPLIB} ${BUILD_DIR}\\" + resname;
Expand Down

0 comments on commit 6dbde78

Please sign in to comment.