diff --git a/network-uri-static.cabal b/network-uri-static.cabal
--- a/network-uri-static.cabal
+++ b/network-uri-static.cabal
@@ -1,5 +1,5 @@
 name: network-uri-static
-version: 0.1.2.0
+version: 0.1.2.1
 synopsis: A small utility to declare type-safe static URIs
 description:
   This library helps you declare type-safe static URIs by parsing URIs at compile time.
@@ -36,7 +36,8 @@
   Default: False
 
 library
-  other-extensions: RecordWildCards,
+  other-extensions: CPP,
+                    RecordWildCards,
                     TemplateHaskell,
                     ViewPatterns
   if flag(defer-to-network-uri)
diff --git a/src/Network/URI/Static.hs b/src/Network/URI/Static.hs
--- a/src/Network/URI/Static.hs
+++ b/src/Network/URI/Static.hs
@@ -1,5 +1,9 @@
-{-# LANGUAGE RecordWildCards, TemplateHaskell, ViewPatterns #-}
+{-# LANGUAGE CPP, RecordWildCards, TemplateHaskell, ViewPatterns #-}
 
+#if MIN_VERSION_network_uri(2,7,0)
+module Network.URI.Static () where
+#else
+
 module Network.URI.Static
     (
     -- * Absolute URIs
@@ -107,3 +111,5 @@
 
 instance Lift URIAuth where
     lift (URIAuth {..}) = [| URIAuth {..} |]
+
+#endif
