Skip to content

Allowing linux builds (Currently filenotfound exception) #2

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

Merged
merged 1 commit into from
Sep 9, 2023

Conversation

CapelaGames
Copy link
Contributor

Currently if you are trying to run shader-ls in linux you get the error: Unhandled exception. System.IO.FileNotFoundException.

Assembly.GetExecutingAssembly().CodeBase was deprecated so, I changed the line to .Location. Which did seem to fix the issue of the file directory string doubling up on linux.

Also, I have modified the ShaderlabDataManager.cs to use "Path.DirectorySeparatorChar.ToString()", because linux uses the / instead of \

I converted it the consts to static instead of const because I'm am using that function instead, otherwise you would get the error "Constant initializer must be compile-time constant" I'm sure you could fix that with #ifdef, but I didn't want to look into it.

Feel free to reject this pull request to implement the changes in your own way.

public static string UNITY3D_FUNCTION_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_functions.def";
public static string UNITY3D_KEYWORD_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_keywords.def";
public static string UNITY3D_MACROS_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_macros.def";
public static string UNITY3D_VALUES_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_values.def";
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can use Path.Combine here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me

@jcs090218 jcs090218 merged commit d27ac1a into shader-ls:master Sep 9, 2023
@jcs090218
Copy link
Member

I've published version 0.1.3. Let me know if it works! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants