Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include object files into image #716

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,8 @@ private static void writePatternEntry(BufferedWriter bw, String pattern) throws

/**
* Loops over every jar on the classpath that isn't a JavaFX jar and checks
* if it contains native static libraries (*.a or *.lib files). If found, the
* libraries are extracted into a temporary folder for use in the link step.
* if it contains native static libraries (*.a or *.lib files) or object files. If found, the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or object files (*.o).

* libraries and object files are extracted into a temporary folder for use in the link step.
*
* @param classPath The classpath of the project
* @throws IOException
Expand All @@ -654,6 +654,9 @@ private void extractNativeLibs(String classPath) throws IOException {
for (String jar : jars) {
FileOps.extractFilesFromJar("." + getStaticLibraryFileExtension(), Path.of(jar),
libPath, getTargetSpecificNativeLibsFilter());
FileOps.extractFilesFromJar(".o" , Path.of(jar),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use getObjectFileExtension() instead of o.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract Path.of(jar) and getTargetSpecificNativeLibsFilter() to variables, as they are used twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use getObjectFileExtension() instead of o.

That would then fail on Windows, as that hard-coded uses ".obj" in Substrate.

Copy link
Contributor

@jperedadnr jperedadnr Aug 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that #718 has been integrated, this can be refactored to include all possible file extensions, creating a list before the for with them.

libPath, getTargetSpecificNativeLibsFilter());

}
}

Expand Down