summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-05-27 16:50:50 +0200
committerJo-Philipp Wich <jow@openwrt.org>2013-05-27 17:06:24 +0200
commit73805dcc03e242fe5e25c9764ed33456acebdb95 (patch)
tree6396e4bfdd9640e8daad40a1d4ce469adc393fd1 /CMakeLists.txt
parent7b63363c22a62e14d05f41c418b98fe4b45db9c3 (diff)
downloadfirewall3-73805dcc03e242fe5e25c9764ed33456acebdb95.tar.gz
Make IPv6 support optional
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 12 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a6f1271..cf7ee96 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(firewall3 C)
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
+SET(iptc_libs ip4tc)
+
SET(sed_match "^[[:space:]]*__ipt_module(\\(.*\\)).*")
SET(sed_replace "-Wl,--undefined=libxt_\\1_init -Wl,--undefined=libipt_\\1_init -Wl,--undefined=libip6t_\\1_init")
@@ -24,14 +26,19 @@ IF (EXISTS "${CMAKE_SOURCE_DIR}/libext4.a")
LIST(APPEND ext_libs ext4)
ENDIF()
-IF (EXISTS "${CMAKE_SOURCE_DIR}/libext6.a")
- ADD_LIBRARY(ext6 STATIC IMPORTED)
- SET_PROPERTY(TARGET ext6 PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libext6.a")
- LIST(APPEND ext_libs ext6)
+IF (NOT DISABLE_IPV6)
+ IF (EXISTS "${CMAKE_SOURCE_DIR}/libext6.a")
+ ADD_LIBRARY(ext6 STATIC IMPORTED)
+ SET_PROPERTY(TARGET ext6 PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libext6.a")
+ LIST(APPEND ext_libs ext6)
+ ENDIF()
+ LIST(APPEND iptc_libs ip6tc)
+ELSE()
+ ADD_DEFINITIONS(-DDISABLE_IPV6)
ENDIF()
ADD_EXECUTABLE(firewall3 main.c options.c defaults.c zones.c forwards.c rules.c redirects.c utils.c ubus.c ipsets.c includes.c iptables.c)
-TARGET_LINK_LIBRARIES(firewall3 uci ubox ubus ip4tc ip6tc xtables m ${ext_libs})
+TARGET_LINK_LIBRARIES(firewall3 uci ubox ubus xtables m ${iptc_libs} ${ext_libs})
SET(CMAKE_INSTALL_PREFIX /usr)