From de98db33fb10a13ead2fa56d6d4c944cedb8fbad Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Sat, 25 Oct 2008 03:29:36 +0000 Subject: [PATCH] CMake: MSVC++ no longer uses a special configuration method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58132 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 8 +------- cmake/config-ix.cmake | 35 ++++++++++++++++++++++++++++++----- cmake/config-w32.cmake | 9 --------- include/llvm/Config/config.h.cmake | 30 +++++++++++++++++++++--------- 4 files changed, 52 insertions(+), 30 deletions(-) delete mode 100755 cmake/config-w32.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 837e8c1aaf8..76ed06cad6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 6cd88da0bc4..58db002d79c 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -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 index d971d2a1370..00000000000 --- a/cmake/config-w32.cmake +++ /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}) diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake index 028e6076e79..9d0265a5518 100644 --- a/include/llvm/Config/config.h.cmake +++ b/include/llvm/Config/config.h.cmake @@ -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 @@ -116,7 +116,7 @@ #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 @@ -367,13 +367,13 @@ #undef HAVE_STRINGS_H /* Define to 1 if you have the 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 @@ -426,7 +426,7 @@ #undef HAVE_U_INT64_T /* Define to 1 if you have the header file. */ -#undef HAVE_WINDOWS_H +#cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H} /* Installation directory for binary executables */ #undef LLVM_BINDIR @@ -477,7 +477,7 @@ #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. */ @@ -485,13 +485,13 @@ /* 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 */ @@ -549,10 +549,22 @@ #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 does not define. */ #undef pid_t /* Define to `unsigned int' if 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} -- 2.11.0