Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by jorgenpt · May 31, 2012 at 08:55 AM · c#gitcompilation

Possible to only compile some scripts?

I've got a set of "library" classes and extension methods I use (published on github). I use git to version my projects, and I'd like to use git submodules to manage "importing" the unity-utilities repository into my current repository.

The problem is that parts of my repository depends on another library (AngryAnt's Path in this case), so it doesn't compile if that library is not present in the project. Not all of my projects include Path - and these projects don't need this part of unity-utilities.

So here's the challenge: How do I prevent it from compiling these (unused) classes when I'm using it in a project without Path? I can't comment out the code, because it's shared code. I tried checkout the submodule outside of Assets and symlinking the parts I use into Assets, but symlinks are not supported on OS X.

Any other ideas?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by whydoidoit · May 31, 2012 at 09:45 AM

How about doing some conditional compilation and set a #if around the code that is only some compiled on occasion - then you could set the #define somewhere and get it switchable? WARNING: I haven't used this but see this thread in which some very smart people discuss a way of getting the #define globally for your project.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jorgenpt · May 31, 2012 at 06:49 PM 0
Share

This seems like just what I needed - I didn't know there was a way to have global defines. The last comment on that thread (page 2) seems to indicate this doesn't work for real "builds" in 3.5, just for editor, so I'll have to investigate it. :-)

I'll mark your answer as accepted if it works for real builds too. Thanks!

avatar image jorgenpt · May 31, 2012 at 09:14 PM 0
Share

Yeah, this is just what I need - I'm adding #if !NO_PATH .. #endif around the code and then I can just do -define:NO_PATH in the smcs.rsp. See my comment here: http://forum.unity3d.com/threads/71445-How-To-Set-Project-Wide-pragma-Directives-with-JavaScript?p=940327&viewfull=1#post940327

Thanks!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Possible to set compiler directives for generated MonoDevelop solution? 0 Answers

Console error is given without filename when compiling 2 Answers

Imported plugins not compiled in firstpass 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges