Separated module compilation from device detection