only build dvpn on Linux

Change-Id: I7027a8678919d4aae98c88b49800dac912c08ae3
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4fb897..4297437 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -307,14 +307,17 @@
     target_include_directories(dsh PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
     install(TARGETS dsh RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
-    add_executable(dvpn
-        tools/dvpn/main.cpp
-        tools/dvpn/dvpn.cpp
-        tools/common.cpp
-        tools/dhtnet_crtmgr/dhtnet_crtmgr.cpp)
-    target_link_libraries(dvpn PRIVATE dhtnet fmt::fmt yaml-cpp)
-    target_include_directories(dvpn PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
-    install(TARGETS dvpn RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+    # dvpn is a Linux-only tool
+    if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+        add_executable(dvpn
+            tools/dvpn/main.cpp
+            tools/dvpn/dvpn.cpp
+            tools/common.cpp
+            tools/dhtnet_crtmgr/dhtnet_crtmgr.cpp)
+        target_link_libraries(dvpn PRIVATE dhtnet fmt::fmt yaml-cpp)
+        target_include_directories(dvpn PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tools)
+        install(TARGETS dvpn RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+    endif()
 
     find_library(READLINE_LIBRARIES readline)
     find_path(READLINE_INCLUDE_DIR readline/readline.h)