[clblas] 09/125: Adding support for msvc11 compilers. Changing the output directory of tplgen to generate the .clT files out-of-source. This way the source directory is not polluted with generated files

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri May 29 06:57:17 UTC 2015


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

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

commit edd8a9e68c9dd10e6979f3f79291f484273fd74f
Author: Kent Knox <kent.knox at amd>
Date:   Sun Aug 18 21:05:51 2013 -0500

    Adding support for msvc11 compilers.  Changing the output directory of tplgen to generate the .clT files out-of-source.  This way the source directory is not polluted with generated files
---
 src/include/defbool.h      |  6 +++---
 src/library/CMakeLists.txt | 44 +++++++++++++++-----------------------------
 src/tests/CMakeLists.txt   |  6 ++++++
 3 files changed, 24 insertions(+), 32 deletions(-)

diff --git a/src/include/defbool.h b/src/include/defbool.h
index e90736d..26caf6a 100644
--- a/src/include/defbool.h
+++ b/src/include/defbool.h
@@ -18,7 +18,7 @@
 #ifndef DEFBOOL_H_
 #define DEFBOOL_H_
 
-#if defined(_MSC_VER) && _MSC_VER <= 1600
+#if defined(_MSC_VER) && _MSC_VER <= 1700
 
 /*
 FIX for windows compilation
@@ -48,10 +48,10 @@ typedef  int  _Bool;
 #endif /* !__cplusplus */
 
 
-#else /* defined(_MSC_VER) && _MSC_VER <= 1600 */
+#else /* defined(_MSC_VER) && _MSC_VER <= 1700 */
 
 #include <stdbool.h>
 
-#endif /* defined(_MSC_VER) && _MSC_VER <= 1600 */
+#endif /* defined(_MSC_VER) && _MSC_VER <= 1700 */
 
 #endif /* DEFBOOL_H_ */
diff --git a/src/library/CMakeLists.txt b/src/library/CMakeLists.txt
index 5bc8e2a..24e0d3f 100644
--- a/src/library/CMakeLists.txt
+++ b/src/library/CMakeLists.txt
@@ -277,35 +277,21 @@ if( BLAS_PRINT_BUILD_ERRORS )
     add_definitions( -DPRINT_BUILD_ERRORS )
 endif()
 
-#add_executable(tplgen tools/tplgen/tplgen.cpp)
-if (CMAKE_COMPILER_IS_GNUCXX)
-    include(ExternalProject)
-    ExternalProject_Add(
-        tplgen
-        URL "${CMAKE_SOURCE_DIR}/library/tools/tplgen"
-        INSTALL_COMMAND ""
-    )
-    add_custom_target( GENERATE_CLT
-                   COMMAND ${CMAKE_BINARY_DIR}/library/tplgen-prefix/src/tplgen-build/tplgen -o ../../include/ ${SRC_CL_TEMPLATES}
-                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/library/blas/gens/clTemplates
-                )
-    add_dependencies(GENERATE_CLT tplgen)
-else()
-    include(ExternalProject)
-    ExternalProject_Add(
-        tplgen
-        URL "${CMAKE_SOURCE_DIR}/library/tools/tplgen"
-        CONFIGURE_COMMAND "${CMAKE_BINARY_DIR}\\library\\tplgen-prefix\\src\\tplgen\\configure.bat"
-        BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Debug
-#        BUILD_COMMAND MSBuild.exe tplgen.sln /m /fl /flp1:logfile=errors.log;errorsonly /flp2:logfile=warnings.log;warningsonly /t:rebuild
-        INSTALL_COMMAND ""
-    )
-    add_custom_target( GENERATE_CLT
-        COMMAND ${CMAKE_BINARY_DIR}\\library\\tplgen-prefix\\src\\tplgen-build\\Debug\\tplgen.exe -o ..\\..\\include ${SRC_CL_TEMPLATES}
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}\\library\\blas\\gens\\clTemplates
-    )
-    add_dependencies(GENERATE_CLT tplgen)
-endif()
+include( ExternalProject )
+ExternalProject_Add( tplgen
+    URL "${CMAKE_SOURCE_DIR}/library/tools/tplgen"
+    INSTALL_COMMAND ""
+)
+
+ExternalProject_Get_Property( tplgen binary_dir )
+
+add_custom_target( GENERATE_CLT
+    COMMAND ${binary_dir}/Debug/tplgen -o ${clBLAS_BINARY_DIR}/include ${SRC_CL_TEMPLATES}
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/library/blas/gens/clTemplates
+)
+
+add_dependencies(GENERATE_CLT tplgen)
+
 add_library(clBLAS SHARED ${CLBLAS_SOURCES} ${GLOBAL_HEADERS} ${SRC_BLAS_HEADERS} ${SRC_BLAS_GENS_HEADERS})
 add_dependencies(clBLAS GENERATE_CLT)
 set_target_properties(clBLAS PROPERTIES VERSION ${clBLAS_VERSION})
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 1f0e07c..be2473e 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -242,6 +242,12 @@ source_group(functional  FILES ${SRC_FUNC} ${FUNC_HEADERS})
 # at paramVal = CL_PROGRAM_BINARIES and several devices in the context
 add_definitions( -DTEST_WITH_SINGLE_DEVICE )
 
+# vs11 needs std::tuples compiled with 10 parameters by default
+# NOTE: this assumes that googletest is compiled with the same preprocessor macro; they must match
+if( MSVC11 )
+	add_definitions( "/D_VARIADIC_MAX=10" )
+endif()
+
 # Having problems on build server, compiling gtest headers with -pedantic; disabling detection of long long
 # http://code.google.com/p/googletest/issues/detail?id=334
 if( CMAKE_COMPILER_IS_GNUCXX )

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



More information about the debian-science-commits mailing list