Commit 8bc1fa73 authored by andrew's avatar andrew

MDEV-3037 - make build work on Windows 64

parent b03e2393
...@@ -16,12 +16,12 @@ ENDIF() ...@@ -16,12 +16,12 @@ ENDIF()
INCLUDE_DIRECTORIES(${Judy_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${Judy_INCLUDE_DIR})
IF(MSVC) IF(MSVC)
# lp:756966 OQGRAPH on Win64 does not compile # # lp:756966 OQGRAPH on Win64 does not compile
IF (CMAKE_SIZEOF_VOID_P EQUAL 8) # IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(BOOST_OK 0) # SET(BOOST_OK 0)
ELSE() # ELSE()
SET(BOOST_OK 1) SET(BOOST_OK 1)
ENDIF() # ENDIF()
ELSE() ELSE()
# See if that works. On old gcc it'll fail because of -fno-rtti # See if that works. On old gcc it'll fail because of -fno-rtti
CHECK_CXX_SOURCE_COMPILES( CHECK_CXX_SOURCE_COMPILES(
...@@ -38,6 +38,8 @@ IF(BOOST_OK) ...@@ -38,6 +38,8 @@ IF(BOOST_OK)
ADD_DEFINITIONS(-DHAVE_OQGRAPH) ADD_DEFINITIONS(-DHAVE_OQGRAPH)
IF(MSVC) IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
# Fix problem with judy not finding inttypes.h on Windows:
ADD_DEFINITIONS(-DJU_WIN)
ELSE(MSVC) ELSE(MSVC)
# Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being # Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive")
......
# - Try to find Judy # - Try to find Judy.
#
# Additionally, on Windows, this module reads hints about search locations from variables:
# JUDY_ROOT - Preferred installation prefix
#
# To build Judy on Windows: (Tested with judy-1.0.5)
#
# * Download the sources tarball from http://sourceforge.net/projects/judy/
# * Extract the source
# * Win32: open the Visual Studio C++ Express 2010 command prompt and navigate to the src/ directory.
# Then execute: build.bat
# * Win64: open the Windows SDK 7.1 Command Prompt and navigate to the src/ directory
# Then execute: build.bat
# * Run the mariadb build with JUDY_ROOT=path\to\judy
#
# Once done this will define # Once done this will define
# #
# Judy_FOUND - system has Judy # Judy_FOUND - system has Judy
...@@ -6,17 +20,37 @@ ...@@ -6,17 +20,37 @@
# Judy_LIBRARIES - Link these to use Judy # Judy_LIBRARIES - Link these to use Judy
# Judy_DEFINITIONS - Compiler switches required for using Judy # Judy_DEFINITIONS - Compiler switches required for using Judy
IF (Judy_INCLUDE_DIR AND Judy_LIBRARIES) IF(MSVC)
SET(Judy_FIND_QUIETLY TRUE) # For now, assume Judy built according to the above instructions
ENDIF (Judy_INCLUDE_DIR AND Judy_LIBRARIES) if (NOT "$ENV{JUDY_ROOT}" STREQUAL "")
# Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
string(REPLACE "\\" "/" Judy_INCLUDE_DIR_search $ENV{JUDY_ROOT}/src)
string(REPLACE "\\" "/" Judy_LIBRARIES_search $ENV{JUDY_ROOT}/src)
endif()
ELSE(MSVC)
IF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
SET(Judy_FIND_QUIETLY TRUE)
ENDIF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
ENDIF(MSVC)
FIND_PATH(Judy_INCLUDE_DIR Judy.h) FIND_PATH(Judy_INCLUDE_DIR Judy.h PATHS ${Judy_INCLUDE_DIR_search})
FIND_LIBRARY(Judy_LIBRARIES NAMES Judy) FIND_LIBRARY(Judy_LIBRARIES Judy PATHS ${Judy_LIBRARIES_search})
IF (Judy_INCLUDE_DIR AND Judy_LIBRARIES) IF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
SET(Judy_FOUND TRUE) SET(Judy_FOUND TRUE)
ELSE (Judy_INCLUDE_DIR AND Judy_LIBRARIES) ELSE (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
SET(Judy_FOUND FALSE) SET(Judy_FOUND FALSE)
if (MSVC)
MESSAGE(STATUS "How to build Judy on Windows:")
MESSAGE(STATUS "1. Download the source tarball from http://sourceforge.net/projects/judy/")
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
MESSAGE(STATUS "2. Extract the source, open the Visual Studio command prompt and navigate to the src/ directory.")
ELSE (CMAKE_SIZEOF_VOID_P EQUAL 8)
MESSAGE(STATUS "2. Extract the source, open the Windows SDK 7.1 Command Prompt and navigate to the src/ directory.")
ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 8)
MESSAGE(STATUS "3. Execute the command: 'build'")
MESSAGE(STATUS "4. Rerun this cmake with the environment variable: 'set JUDY_ROOT=x:\\path\\to\\judy'")
endif(MSVC)
ENDIF (Judy_INCLUDE_DIR AND Judy_LIBRARIES) ENDIF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
IF (Judy_FOUND) IF (Judy_FOUND)
......
...@@ -184,6 +184,10 @@ namespace oqgraph3 ...@@ -184,6 +184,10 @@ namespace oqgraph3
typedef edge_info key_type; typedef edge_info key_type;
typedef boost::readable_property_map_tag category; typedef boost::readable_property_map_tag category;
edge_weight_property_map(const graph& g) : _g(g) { } edge_weight_property_map(const graph& g) : _g(g) { }
friend inline reference
get(const edge_weight_property_map& p, const key_type& key)
{ return key.weight(); }
const graph& _g; const graph& _g;
}; };
...@@ -436,16 +440,6 @@ namespace boost ...@@ -436,16 +440,6 @@ namespace boost
const oqgraph3::graph& g) const oqgraph3::graph& g)
{ return property_map<oqgraph3::graph, edge_weight_t>::const_type(g); } { return property_map<oqgraph3::graph, edge_weight_t>::const_type(g); }
inline property_map<
oqgraph3::graph,
edge_weight_t>::const_type::reference
get(const property_map<oqgraph3::graph,
edge_weight_t>::const_type& p,
const property_map<
oqgraph3::graph,
edge_weight_t>::const_type::key_type& key)
{ return key.weight(); }
inline property_map< inline property_map<
oqgraph3::graph, oqgraph3::graph,
edge_index_t>::const_type::reference edge_index_t>::const_type::reference
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment