Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

build: feature gate arch and cpu specific code #316

Merged
merged 2 commits into from
Jun 18, 2015

Conversation

mcoffin
Copy link
Contributor

@mcoffin mcoffin commented Jun 9, 2015

This will make zinc compatible for compilation for the build system.

Eventually, we should move architecture specific code somewhere, but this will suffice until then.

@@ -22,14 +22,23 @@ and each such struct has a `setup()` method that configures the hardware
*/


#[cfg(feature = "mcu_lpc17xx")]
Copy link
Member

Choose a reason for hiding this comment

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

That's actually a bad idea I guess, as it feature-gates mcu code from being unit tested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But wouldn't you then just test with the features enabled (which we already do)? As a bonus it has exposed some misuse of hal code. I think this is the accepted way of doing it as features are kind of like optional dependencies (which you're allowed to test without). But you can also test with them (which we do with the matrix for travis & build tasks for jenkins).

Copy link
Member

Choose a reason for hiding this comment

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

I mean — test the specific parts of the mcu hal, like doing a volatilecell replay verification for uart setup.

Copy link
Member

Choose a reason for hiding this comment

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

Wait, your comment actually makes sense to me now.

👍

@mcoffin
Copy link
Contributor Author

mcoffin commented Jun 10, 2015

Closes #303

@mcoffin
Copy link
Contributor Author

mcoffin commented Jun 10, 2015

It would be nice if rustc would pass target_cpu as a cfg attribute, but it does not. might consider asking upstream if they'll add it.

This would get rid of the cpu_* features in cargo.

@mcoffin
Copy link
Contributor Author

mcoffin commented Jun 18, 2015

retest this please

@farcaller
Copy link
Member

And this is why you don't use socat to proxy the requests into vm. LGTM though.

farcaller added a commit that referenced this pull request Jun 18, 2015
build: feature gate arch and cpu specific code
@farcaller farcaller merged commit 352a806 into hackndev:master Jun 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants