[arrayfire] 72/84: Adding a Fast configuration

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Jan 4 23:22:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository arrayfire.

commit 091cdf9143a944784c5e35671927509d4f8b3d70
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Tue Dec 29 19:19:31 2015 -0500

    Adding a Fast configuration
---
 CMakeLists.txt                | 19 ++++++++---
 CMakeModules/FastConfig.cmake | 78 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea92cbe..5478143 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,13 +37,22 @@ MARK_AS_ADVANCED(BUILD_SIFT)
 
 OPTION(BUILD_UNIFIED "Build Backend-Independent ArrayFire API" ON)
 
+# Add a Fast compiling config
+INCLUDE("${CMAKE_MODULE_PATH}/FastConfig.cmake")
+
 # Set a default build type if none was specified
-if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
-    set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
+IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+    SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
     # Set the possible values of build type for cmake-gui
-    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
-      "MinSizeRel" "RelWithDebInfo")
-endif()
+
+    IF(${FAST_CONFIG_ENABLED})
+        SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
+            "Debug" "Fast" "Release" "MinSizeRel" "RelWithDebInfo")
+    ELSE()
+        SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
+            "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+    ENDIF()
+ENDIF()
 
 FIND_PACKAGE(FreeImage)
 IF(FREEIMAGE_FOUND)
diff --git a/CMakeModules/FastConfig.cmake b/CMakeModules/FastConfig.cmake
new file mode 100644
index 0000000..4a9a2cd
--- /dev/null
+++ b/CMakeModules/FastConfig.cmake
@@ -0,0 +1,78 @@
+MESSAGE(STATUS "Adding Fast Build Type")
+
+IF(MSVC)
+
+    SET(CMAKE_CXX_FLAGS_FAST
+        "/MD /Od /Ob1 /D NDEBUG"
+        CACHE STRING "Flags used by the C++ compiler during Fast builds."
+        FORCE )
+    SET(CMAKE_C_FLAGS_FAST
+        "/MD /Od /Ob1 /D NDEBUG"
+        CACHE STRING "Flags used by the C compiler during Fast builds."
+        FORCE )
+    SET(CMAKE_EXE_LINKER_FLAGS_FAST
+        "/INCREMENTAL:NO"
+        CACHE STRING "Flags used for linking binaries during Fast builds."
+        FORCE )
+    SET(CMAKE_MODULE_LINKER_FLAGS_FAST
+        "/INCREMENTAL:NO"
+        CACHE STRING "Flags used by the modules linker during Fast builds."
+        FORCE )
+    SET(CMAKE_STATIC_LINKER_FLAGS_FAST
+        ""
+        CACHE STRING "Flags used by the static libraries linker during Fast builds."
+        FORCE )
+    SET(CMAKE_SHARED_LINKER_FLAGS_FAST
+        "/INCREMENTAL:NO"
+        CACHE STRING "Flags used by the shared libraries linker during Fast builds."
+        FORCE )
+
+    LIST(APPEND CMAKE_CONFIGURATION_TYPES Fast)
+    LIST(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
+    SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
+        "Semicolon separated list of supported configuration types [Debug|Release|MinSizeRel|RelWithDebInfo|Fast]"
+        FORCE)
+
+    # Needed for config to show up in VS
+    # http://cmake.3232098.n2.nabble.com/Custom-configuration-types-in-Visual-Studio-td7181786.html
+    ENABLE_LANGUAGE(CXX)
+
+ELSE(MSVC)
+
+    SET(CMAKE_CXX_FLAGS_FAST
+        "-O0 -DNDEBUG"
+        CACHE STRING "Flags used by the C++ compiler during Fast builds."
+        FORCE )
+    SET(CMAKE_C_FLAGS_FAST
+        "-O0 -DNDEBUG"
+        CACHE STRING "Flags used by the C compiler during Fast builds."
+        FORCE )
+    SET(CMAKE_EXE_LINKER_FLAGS_FAST
+        ""
+        CACHE STRING "Flags used for linking binaries during Fast builds."
+        FORCE )
+    SET(CMAKE_MODULE_LINKER_FLAGS_FAST
+        ""
+        CACHE STRING "Flags used by the modules linker during Fast builds."
+        FORCE )
+    SET(CMAKE_STATIC_LINKER_FLAGS_FAST
+        ""
+        CACHE STRING "Flags used by the static libraries linker during Fast builds."
+        FORCE )
+    SET(CMAKE_SHARED_LINKER_FLAGS_FAST
+        ""
+        CACHE STRING "Flags used by the shared libraries linker during Fast builds."
+        FORCE )
+
+ENDIF(MSVC)
+
+SET(FAST_CONFIG_ENABLED ON CACHE INTERNAL "" FORCE)
+
+MARK_AS_ADVANCED(
+    CMAKE_CXX_FLAGS_FAST
+    CMAKE_C_FLAGS_FAST
+    CMAKE_EXE_LINKER_FLAGS_FAST
+    CMAKE_MODULE_LINKER_FLAGS_FAST
+    CMAKE_STATIC_LINKER_FLAGS_FAST
+    CMAKE_SHARED_LINKER_FLAGS_FAST
+    )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list