Add more Boost libraries on Windows, fix TBB debug linking, stop building
on old Microsoft compilers
This commit is contained in:
parent
e49720f34a
commit
0e16c4ed97
@ -16,6 +16,11 @@ else()
|
|||||||
message(WARNING "Building on a 32 bit system is unsupported")
|
message(WARNING "Building on a 32 bit system is unsupported")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (WIN32 AND MSVC_VERSION LESS 1800)
|
||||||
|
message(FATAL_ERROR "Building with Microsoft compiler needs Visual Studio 2013 or later (Express version works too)")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
OPTION(WITH_TOOLS "Build ORSM tools" OFF)
|
OPTION(WITH_TOOLS "Build ORSM tools" OFF)
|
||||||
|
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Include/)
|
include_directories(${CMAKE_SOURCE_DIR}/Include/)
|
||||||
@ -115,6 +120,7 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -wd10237 -Wall -ipo -fPIC")
|
||||||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
# using Visual Studio C++
|
# using Visual Studio C++
|
||||||
|
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time chrono zlib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# disable partitioning of LTO process when possible (fixes Debian issues)
|
# disable partitioning of LTO process when possible (fixes Debian issues)
|
||||||
@ -130,7 +136,9 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LTO_FLAGS} ${LTO_P
|
|||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LTO_FLAGS} ${LTO_PARTITION_FLAGS}")
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LTO_FLAGS} ${LTO_PARTITION_FLAGS}")
|
||||||
|
|
||||||
# Activate C++11
|
# Activate C++11
|
||||||
ADD_DEFINITIONS(-std=c++11)
|
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
|
ADD_DEFINITIONS(-std=c++11)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Configuring other platform dependencies
|
# Configuring other platform dependencies
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
@ -172,6 +180,10 @@ target_link_libraries(osrm-datastore ${CMAKE_THREAD_LIBS_INIT})
|
|||||||
target_link_libraries(OSRM ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(OSRM ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
find_package(TBB REQUIRED)
|
find_package(TBB REQUIRED)
|
||||||
|
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
|
set(TBB_LIBRARIES ${TBB_DEBUG_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
target_link_libraries(osrm-datastore ${TBB_LIBRARIES})
|
||||||
target_link_libraries(osrm-extract ${TBB_LIBRARIES})
|
target_link_libraries(osrm-extract ${TBB_LIBRARIES})
|
||||||
target_link_libraries(osrm-prepare ${TBB_LIBRARIES})
|
target_link_libraries(osrm-prepare ${TBB_LIBRARIES})
|
||||||
target_link_libraries(osrm-routed ${TBB_LIBRARIES})
|
target_link_libraries(osrm-routed ${TBB_LIBRARIES})
|
||||||
|
Loading…
Reference in New Issue
Block a user