CMake: MSVC++ no longer uses a special configuration method.
authorOscar Fuentes <ofv@wanadoo.es>
Sat, 25 Oct 2008 03:29:36 +0000 (03:29 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Sat, 25 Oct 2008 03:29:36 +0000 (03:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58132 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
cmake/config-ix.cmake
cmake/config-w32.cmake [deleted file]
include/llvm/Config/config.h.cmake

index 837e8c1aaf893caba301c01236aa8b589e2b6d39..76ed06cad6a517dc9fefd4b96d5ed860ea9e3bf0 100644 (file)
@@ -65,13 +65,7 @@ endif( EXISTS ${LLVM_TOOLS_BINARY_DIR}/llvm-config )
 # find_file(HAVE_LLVM_CONFIG llvm-config ${LLVM_TOOLS_BINARY_DIR})
 # message(STATUS ${HAVE_LLVM_CONFIG})
 
-if( MSVC )
-  message(STATUS "Configuring using MSVC hack.")
-  include(config-w32)
-else( MSVC )
-  message(STATUS "Configuring traditional style.")
-  include(config-ix)
-endif( MSVC )
+include(config-ix)
 
 set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} )
 set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
index 6cd88da0bc43f1b169fc902d44d1eef3a1095ae5..58db002d79cd82209ae9e92e2072e5593f6a54ed 100755 (executable)
@@ -23,6 +23,7 @@ check_include_file(signal.h HAVE_SIGNAL_H)
 check_include_file(stdint.h HAVE_STDINT_H)
 check_include_file(stdio.h HAVE_STDIO_H)
 check_include_file(stdlib.h HAVE_STDLIB_H)
+check_include_file(string.h HAVE_STRING_H)
 check_include_file(sys/dir.h HAVE_SYS_DIR_H)
 check_include_file(sys/dl.h HAVE_SYS_DL_H)
 check_include_file(sys/mman.h HAVE_SYS_MMAN_H)
@@ -34,6 +35,7 @@ check_include_file(sys/time.h HAVE_SYS_TIME_H)
 check_include_file(sys/types.h HAVE_SYS_TYPES_H)
 check_include_file(unistd.h HAVE_UNISTD_H)
 check_include_file(utime.h HAVE_UTIME_H)
+check_include_file(windows.h HAVE_WINDOWS_H)
 
 # function checks
 include(CheckSymbolExists)
@@ -44,8 +46,11 @@ check_symbol_exists(isinf cmath HAVE_ISINF_IN_CMATH)
 check_symbol_exists(isinf math.h HAVE_ISINF_IN_MATH_H)
 check_symbol_exists(isnan cmath HAVE_ISNAN_IN_CMATH)
 check_symbol_exists(isnan math.h HAVE_ISNAN_IN_MATH_H)
+check_symbol_exists(ceilf math.h HAVE_CEILF)
+check_symbol_exists(floorf math.h HAVE_FLOORF)
 check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
 check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
+check_symbol_exists(strtoll stdlib.h HAVE_STRTOLL)
 
 if( MINGW )
   # tbi: Comprobar que existen las librerias:
@@ -55,11 +60,31 @@ if( MINGW )
   #   CHECK_LIBRARY_EXISTS(imagehlp ??? . HAVE_LIBIMAGEHLP)
 endif( MINGW )
 
-# Classes
-include(CheckCxxHashmap)
-include(CheckCxxHashset)
-check_hashmap()
-check_hashset()
+if( MSVC )
+  set(error_t int)
+  set(LTDL_SHLIBPATH_VAR "PATH")
+  set(LTDL_SYSSEARCHPATH "")
+  set(LTDL_DLOPEN_DEPLIBS 1)
+  set(SHLIBEXT ".lib")
+  set(LTDL_OBJDIR "_libs")
+  set(HAVE_STRTOLL 1)
+  set(strtoll "_strtoi64")
+  set(strtoull "_strtoui64")
+  set(stricmp "_stricmp")
+  set(strdup "_strdup")
+else( MSVC )
+  set(LTDL_SHLIBPATH_VAR "LD_LIBRARY_PATH")
+  set(LTDL_SYSSEARCHPATH "") # TODO
+  set(LTDL_DLOPEN_DEPLIBS 0)  # TODO
+endif( MSVC )
+
+if( NOT MSVC )
+  # hash_map.h.in and hash_set.h.in contain a special case for MSVC
+  include(CheckCxxHashmap)
+  include(CheckCxxHashset)
+  check_hashmap()
+  check_hashset()
+endif( NOT MSVC )
 
 # FIXME: Signal handler return type, currently hardcoded to 'void'
 set(RETSIGTYPE void)
diff --git a/cmake/config-w32.cmake b/cmake/config-w32.cmake
deleted file mode 100755 (executable)
index d971d2a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# tbi: Configurar ficheros.
-configure_file(${llvm_include_path}/llvm/ADT/hash_map.h.in ${llvm_builded_incs_dir}/ADT/hash_map.h COPYONLY)
-configure_file(${llvm_include_path}/llvm/ADT/hash_set.h.in ${llvm_builded_incs_dir}/ADT/hash_set.h COPYONLY)
-configure_file(${llvm_include_path}/llvm/ADT/iterator.h.in ${llvm_builded_incs_dir}/ADT/iterator.h COPYONLY)
-configure_file(${llvm_include_path}/llvm/Support/DataTypes.h.in ${llvm_builded_incs_dir}/Support/DataTypes.h COPYONLY)
-configure_file(${llvm_include_path}/llvm/Config/config.h.in ${llvm_builded_incs_dir}/Config/config.h COPYONLY)
-
-file(READ ${llvm_include_path}/../win32/config.h vc_config_text)
-file(APPEND ${llvm_builded_incs_dir}/Config/config.h ${vc_config_text})
index 028e6076e797d77c08572585f5a428bb73b5b9e4..9d0265a551888c58832d64596d5d13102366d004 100644 (file)
@@ -61,7 +61,7 @@
 #undef HAVE_BI_ITERATOR
 
 /* Define to 1 if you have the `ceilf' function. */
-#undef HAVE_CEILF
+#cmakedefine HAVE_CEILF ${HAVE_CEILF}
 
 /* Define to 1 if you have the `closedir' function. */
 #undef HAVE_CLOSEDIR
 #undef HAVE_FINITE_IN_IEEEFP_H
 
 /* Define to 1 if you have the `floorf' function. */
-#undef HAVE_FLOORF
+#cmakedefine HAVE_FLOORF ${HAVE_FLOORF}
 
 /* Does not have forward iterator */
 #undef HAVE_FWD_ITERATOR
 #undef HAVE_STRINGS_H
 
 /* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+#cmakedefine HAVE_STRING_H ${HAVE_STRING_H}
 
 /* Define to 1 if you have the `strrchr' function. */
 #undef HAVE_STRRCHR
 
 /* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
+#cmakedefine HAVE_STRTOLL ${HAVE_STRTOLL}
 
 /* Define to 1 if you have the `strtoq' function. */
 #undef HAVE_STRTOQ
 #undef HAVE_U_INT64_T
 
 /* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
+#cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H}
 
 /* Installation directory for binary executables */
 #undef LLVM_BINDIR
 #undef LLVM_PREFIX
 
 /* Define if the OS needs help to load dependent libraries for dlopen(). */
-#undef LTDL_DLOPEN_DEPLIBS
+#cmakedefine LTDL_DLOPEN_DEPLIBS ${LTDL_DLOPEN_DEPLIBS}
 
 /* Define to the sub-directory in which libtool stores uninstalled libraries.
    */
 
 /* Define to the name of the environment variable that determines the dynamic
    library search path. */
-#undef LTDL_SHLIBPATH_VAR
+#cmakedefine LTDL_SHLIBPATH_VAR "${LTDL_SHLIBPATH_VAR}"
 
 /* Define to the extension used for shared libraries, say, ".so". */
 #cmakedefine LTDL_SHLIB_EXT "${LTDL_SHLIB_EXT}"
 
 /* Define to the system default library search path. */
-#undef LTDL_SYSSEARCHPATH
+#cmakedefine LTDL_SYSSEARCHPATH "${LTDL_SYSSEARCHPATH}"
 
 /* Define if /dev/zero should be used when mapping RWX memory, or undefine if
    its not necessary */
 #undef const
 
 /* Define to a type to use for `error_t' if it is not otherwise available. */
-#undef error_t
+#cmakedefine error_t ${error_t}
 
 /* Define to `int' if <sys/types.h> does not define. */
 #undef pid_t
 
 /* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
+
+/* Define to a function replacing strtoll */
+#cmakedefine strtoll ${strtoll}
+
+/* Define to a function implementing strtoull */
+#cmakedefine strtoull ${strtoull}
+
+/* Define to a function implementing stricmp */
+#cmakedefine stricmp ${stricmp}
+
+/* Define to a function implementing strdup */
+#cmakedefine strdup ${strdup}