Skip to content
This repository was archived by the owner on Dec 7, 2019. It is now read-only.
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
13 changes: 7 additions & 6 deletions Source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ else
endif

GAMEDATA := ${KSPDIR}/GameData
APIGAMEDATA := ${GAMEDATA}/KSPAPIExt
PLUGINDIR := ${APIGAMEDATA}/Plugins
KSPAPIEXT := ../../KSPAPIExtensions/Source

TARGETS := ProceduralParts.dll

Expand All @@ -36,10 +33,14 @@ API_FILES := \
zzVersionChecker.cs \
ICostModifier.cs \
VectorUtils.cs \
KSPUtils.cs \
UnityUtils.cs \
EngineWrapper.cs \
MathUtils.cs \
$e

RESGEN2 := resgen2
GMCS := gmcs
Copy link
Owner

Choose a reason for hiding this comment

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

Why are you changing gmcs to mcs?

Copy link
Author

Choose a reason for hiding this comment

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

I'm using Mono, which has unified the various c# compilers into mcs. I don't know if this is the case on other systems or not.

https://www.mono-project.com/docs/about-mono/languages/csharp/

Copy link
Owner

Choose a reason for hiding this comment

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

So Mono 2.11 unified them. If this is the case, replace the GMCS variable with MCS as well. GMCS := gmcs makes sense but GMCS := mcs does not.

Copy link
Owner

Choose a reason for hiding this comment

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

In addition, it would be good to add -langversion:ISO-2 -sdk:2 after ${GMCS} to make sure we target the same version as gmcs.

Copy link
Author

Choose a reason for hiding this comment

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

Nice thought, but it won't compile because there's lambda expressions and other language features used not in the C# 2.0 specification.

GMCS := mcs
GIT := git
TAR := tar
ZIP := zip
Expand All @@ -61,8 +62,8 @@ info:
@echo " Plugin: ${PLUGINDIR}"

ProceduralParts.dll: ${API_FILES}
${GMCS} -unsafe -t:library -lib:${APIEXTDATA},${MANAGED},${KSPAPIEXT} \
-r:Assembly-CSharp,Assembly-CSharp-firstpass,UnityEngine,KSPAPIExtensions \
${GMCS} -unsafe -t:library -lib:${MANAGED} \
-r:Assembly-CSharp,Assembly-CSharp-firstpass,UnityEngine,UnityEngine.UI \
-out:$@ $^

clean:
Expand Down