Callback: work at any arity
[xonotic/netradiant.git] / CMakeLists.txt
index 397737a..d2e87cd 100644 (file)
@@ -63,15 +63,36 @@ endif ()
 #-----------------------------------------------------------------------
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
-macro(addflags args)
+macro(addflags_c args)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${args}")
+endmacro()
+macro(addflags_cxx args)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${args}")
 endmacro()
+macro(addflags args)
+    addflags_c("${args}")
+    addflags_cxx("${args}")
+endmacro()
 addflags("-fno-strict-aliasing")
 if (NOT WIN32)
     addflags("-fvisibility=hidden")
 endif ()
 
+if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+    addflags("-Werror")
+    addflags("-pedantic-errors")
+endif ()
+
+addflags("-Wall")
+addflags("-Wextra")
+addflags("-pedantic")
+
+addflags_c("-Wno-deprecated-declarations") # vfs.c: g_strdown
+
+addflags("-Wno-unused-function")
+addflags("-Wno-unused-variable")
+addflags("-Wno-unused-parameter")
+
 set(CMAKE_POSITION_INDEPENDENT_CODE 1)
 set(GTK_TARGET 2 CACHE STRING "GTK target")
 add_definitions(-DGTK_TARGET=${GTK_TARGET})
@@ -228,13 +249,24 @@ endif ()
 #-----------------------------------------------------------------------
 
 option(DOWNLOAD_GAMEPACKS "Download game packs" ON)
-add_custom_target(game_packs
+add_custom_target(game_packs_free
         COMMAND ${CMAKE_COMMAND} -E make_directory games
         COMMAND DOWNLOAD_GAMEPACKS=yes SOURCE_DIR="${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/install-gamepacks.sh" "${PROJECT_BINARY_DIR}"
-        COMMENT "Downloading game packs"
+        COMMENT "Downloading free game packs"
         )
+add_custom_target(game_packs_all
+        COMMAND ${CMAKE_COMMAND} -E make_directory games
+        COMMAND DOWNLOAD_GAMEPACKS=all SOURCE_DIR="${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/install-gamepacks.sh" "${PROJECT_BINARY_DIR}"
+        COMMENT "Downloading all game packs"
+        )
+
 if (DOWNLOAD_GAMEPACKS)
-    add_custom_target(game_packs_all ALL DEPENDS game_packs)
+    set(DOWNLOAD_GAMEPACKS "all")
+endif()
+if ("${DOWNLOAD_GAMEPACKS}" STREQUAL "free")
+    add_custom_target(game_packs_go ALL DEPENDS game_packs_free)
+elseif ("${DOWNLOAD_GAMEPACKS}" STREQUAL "all")
+    add_custom_target(game_packs_go ALL DEPENDS game_packs_all)
 endif ()
 
 #-----------------------------------------------------------------------