Set the compiler flags in a better way.
This commit was SVN r25125.
Этот коммит содержится в:
родитель
92c7372e20
Коммит
0aea775837
@ -28,8 +28,8 @@ IF(MSVC)
|
|||||||
ELSE(CMAKE_CL_64)
|
ELSE(CMAKE_CL_64)
|
||||||
SET(COMPILER_TYPE "win32")
|
SET(COMPILER_TYPE "win32")
|
||||||
ENDIF(CMAKE_CL_64)
|
ENDIF(CMAKE_CL_64)
|
||||||
ELSEIF("${CMAKE_GENERATOR}" STREQUAL "MinGW Makefiles")
|
ELSEIF("${CMAKE_GENERATOR}" STREQUAL "MSYS Makefiles")
|
||||||
SET(WINDOWS_MINGW TRUE CACHE INTERNAL "Windows MinGW env")
|
SET(WINDOWS_MINGW TRUE CACHE INTERNAL "Windows MSYS env")
|
||||||
ENDIF(MSVC)
|
ENDIF(MSVC)
|
||||||
|
|
||||||
SET (OpenMPI_VERSION $(OpenMPI_MAJOR_VERSION).$(OpenMPI_MINOR_VERSION).$(OpenMPI_PATCH_VERSION))
|
SET (OpenMPI_VERSION $(OpenMPI_MAJOR_VERSION).$(OpenMPI_MINOR_VERSION).$(OpenMPI_PATCH_VERSION))
|
||||||
|
@ -122,16 +122,17 @@ ADD_LIBRARY (libmpi ${OMPI_SOURCE_FILES})
|
|||||||
ADD_DEPENDENCIES(libmpi libopen-rte libopen-pal)
|
ADD_DEPENDENCIES(libmpi libopen-rte libopen-pal)
|
||||||
|
|
||||||
SET_TARGET_PROPERTIES(libmpi PROPERTIES
|
SET_TARGET_PROPERTIES(libmpi PROPERTIES
|
||||||
COMPILE_FLAGS "${OMPI_C_DEF_PRE}OMPI_MPIHANDLES_DLL_PREFIX=libompi_dbg_mpihandles ${OMPI_C_DEF_PRE}OMPI_MSGQ_DLL_PREFIX=libompi_dbg_msgq ${OMPI_C_DEF_PRE}OMPI_BUILDING ${OMPI_C_DEF_PRE}OMPI_BUILDING_CXX_BINDINGS_LIBRARY")
|
COMPILE_DEFINITIONS "OMPI_MPIHANDLES_DLL_PREFIX=libompi_dbg_mpihandles;OMPI_MSGQ_DLL_PREFIX=libompi_dbg_msgq;OMPI_BUILDING;OMPI_BUILDING_CXX_BINDINGS_LIBRARY")
|
||||||
|
|
||||||
# Set compile flags for this target
|
# Set compile flags for this target
|
||||||
IF (BUILD_SHARED_LIBS)
|
IF (BUILD_SHARED_LIBS)
|
||||||
SET_TARGET_PROPERTIES(libmpi PROPERTIES
|
SET_TARGET_PROPERTIES(libmpi PROPERTIES
|
||||||
COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}HAVE_CONFIG_H ${OMPI_C_DEF_PRE}OMPI_EXPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_C_DEF_PRE}ORTE_IMPORTS ${OMPI_CXX_LAN_FLAG}" PREFIX "" IMPORT_PREFIX "")
|
COMPILE_DEFINITIONS "_USRDLL;HAVE_CONFIG_H;OMPI_EXPORTS;OPAL_IMPORTS;ORTE_IMPORTS"
|
||||||
|
COMPILE_FLAGS "${OMPI_CXX_LAN_FLAG}" PREFIX "" IMPORT_PREFIX "")
|
||||||
TARGET_LINK_LIBRARIES (libmpi ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib
|
TARGET_LINK_LIBRARIES (libmpi ${OpenMPI_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event${CMAKE_DEBUG_POSTFIX}.lib
|
||||||
libopen-rte Ws2_32.lib shlwapi.lib ${EXTRA_LINK_LIBRARIES})
|
libopen-rte Ws2_32.lib shlwapi.lib ${EXTRA_LINK_LIBRARIES})
|
||||||
ELSE (BUILD_SHARED_LIBS)
|
ELSE (BUILD_SHARED_LIBS)
|
||||||
SET_TARGET_PROPERTIES(libmpi PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_LIB")
|
SET_TARGET_PROPERTIES(libmpi PROPERTIES COMPILE_DEFINITIONS "${OMPI_C_DEF_PRE}_LIB")
|
||||||
ENDIF(BUILD_SHARED_LIBS)
|
ENDIF(BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
# generate ompi_config.h
|
# generate ompi_config.h
|
||||||
|
@ -115,7 +115,8 @@ IF (BUILD_SHARED_LIBS)
|
|||||||
)
|
)
|
||||||
ENDIF(WINDOWS_MINGW)
|
ENDIF(WINDOWS_MINGW)
|
||||||
|
|
||||||
SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}OPAL_EXPORTS" PREFIX "" IMPORT_PREFIX "")
|
SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_DEFINITIONS "_USRDLL;OPAL_EXPORTS"
|
||||||
|
PREFIX "" IMPORT_PREFIX "")
|
||||||
IF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND)
|
IF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND)
|
||||||
INCLUDE_DIRECTORIES(${LIBLTDL_INCLUDE_PATH})
|
INCLUDE_DIRECTORIES(${LIBLTDL_INCLUDE_PATH})
|
||||||
TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib ${LIBLTDL_LIB})
|
TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib ${LIBLTDL_LIB})
|
||||||
@ -123,7 +124,7 @@ IF (BUILD_SHARED_LIBS)
|
|||||||
TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib)
|
TARGET_LINK_LIBRARIES (libopen-pal Ws2_32.lib shlwapi.lib)
|
||||||
ENDIF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND)
|
ENDIF(OPAL_WANT_LIBLTDL AND LIBLTDL_FOUND)
|
||||||
ELSE (BUILD_SHARED_LIBS)
|
ELSE (BUILD_SHARED_LIBS)
|
||||||
SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_LIB")
|
SET_TARGET_PROPERTIES(libopen-pal PROPERTIES COMPILE_DEFINITIONS _LIB)
|
||||||
ENDIF(BUILD_SHARED_LIBS)
|
ENDIF(BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
# Generate install_dirs.h
|
# Generate install_dirs.h
|
||||||
|
@ -60,8 +60,8 @@ ENDIF(WINDOWS_MINGW)
|
|||||||
|
|
||||||
# Set compile flags for this target
|
# Set compile flags for this target
|
||||||
IF (BUILD_SHARED_LIBS)
|
IF (BUILD_SHARED_LIBS)
|
||||||
SET_TARGET_PROPERTIES(libopen-rte PROPERTIES
|
SET_TARGET_PROPERTIES(libopen-rte PROPERTIES COMPILE_DEFINITIONS "_USRDLL;ORTE_EXPORTS;OPAL_IMPORTS"
|
||||||
COMPILE_FLAGS "${OMPI_C_DEF_PRE}_USRDLL ${OMPI_C_DEF_PRE}ORTE_EXPORTS ${OMPI_C_DEF_PRE}OPAL_IMPORTS ${OMPI_CXX_LAN_FLAG}" PREFIX "" IMPORT_PREFIX "")
|
COMPILE_FLAGS "${OMPI_CXX_LAN_FLAG}" PREFIX "" IMPORT_PREFIX "")
|
||||||
|
|
||||||
IF(WINDOWS_MINGW)
|
IF(WINDOWS_MINGW)
|
||||||
TARGET_LINK_LIBRARIES(libopen-rte ${OpenMPI_BINARY_DIR}/event${CMAKE_DEBUG_POSTFIX}.lib
|
TARGET_LINK_LIBRARIES(libopen-rte ${OpenMPI_BINARY_DIR}/event${CMAKE_DEBUG_POSTFIX}.lib
|
||||||
@ -71,7 +71,8 @@ IF (BUILD_SHARED_LIBS)
|
|||||||
libopen-pal Ws2_32.lib shlwapi.lib)
|
libopen-pal Ws2_32.lib shlwapi.lib)
|
||||||
ENDIF(WINDOWS_MINGW)
|
ENDIF(WINDOWS_MINGW)
|
||||||
ELSE (BUILD_SHARED_LIBS)
|
ELSE (BUILD_SHARED_LIBS)
|
||||||
SET_TARGET_PROPERTIES(libopen-rte PROPERTIES COMPILE_FLAGS "${OMPI_C_DEF_PRE}_LIB ${OMPI_CXX_LAN_FLAG}")
|
SET_TARGET_PROPERTIES(libopen-rte PROPERTIES COMPILE_DEFINITIONS "${OMPI_C_DEF_PRE}_LIB"
|
||||||
|
COMPILE_FLAGS "${OMPI_CXX_LAN_FLAG}")
|
||||||
ENDIF(BUILD_SHARED_LIBS)
|
ENDIF(BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
# generate orte_config.h
|
# generate orte_config.h
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user