From 0e16c4ed97ae16db78918b75ec5b9490fee69836 Mon Sep 17 00:00:00 2001 From: Alexei Kasatkin Date: Fri, 23 May 2014 23:15:51 +0600 Subject: [PATCH 01/10] Add more Boost libraries on Windows, fix TBB debug linking, stop building on old Microsoft compilers --- CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 106399f53..15b85457f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,11 @@ else() message(WARNING "Building on a 32 bit system is unsupported") 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) 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") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # using Visual Studio C++ + set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time chrono zlib) endif() # 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}") # 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 if(APPLE) @@ -172,6 +180,10 @@ target_link_libraries(osrm-datastore ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(OSRM ${CMAKE_THREAD_LIBS_INIT}) 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-prepare ${TBB_LIBRARIES}) target_link_libraries(osrm-routed ${TBB_LIBRARIES}) From 020927283131363a10621b33e5ad45d48f523ba3 Mon Sep 17 00:00:00 2001 From: Alexei Kasatkin Date: Fri, 23 May 2014 21:34:15 +0600 Subject: [PATCH 02/10] fix includes and definitions (avoid unistd.h, isatty, fix min,max, round and M_PI) --- CMakeLists.txt | 4 ++++ Util/SimpleLogger.h | 7 +++++++ typedefs.h | 1 - 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15b85457f..a1c9f4c1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,10 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # using Visual Studio C++ set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time chrono zlib) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_definitions(-DNOMINMAX) # avoid min and max macros that can break compilation + add_definitions(-D_USE_MATH_DEFINES) # define M_PI + add_definitions(-D_WIN32_WINNT=0x0501) endif() # disable partitioning of LTO process when possible (fixes Debian issues) diff --git a/Util/SimpleLogger.h b/Util/SimpleLogger.h index fac4a59db..f154b0e82 100644 --- a/Util/SimpleLogger.h +++ b/Util/SimpleLogger.h @@ -31,7 +31,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include + +#ifdef _MSC_VER +#include +#define isatty _isatty +#define fileno _fileno +#else #include +#endif #include #include diff --git a/typedefs.h b/typedefs.h index 3a042804f..c39cd1e63 100644 --- a/typedefs.h +++ b/typedefs.h @@ -36,7 +36,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define M_PI 3.14159265358979323846 #endif -template digitT round(digitT x) { return std::floor(x + 0.5); } #endif typedef unsigned int NodeID; From 75303c95f8d75e8bec31f959dc518465c02a7e45 Mon Sep 17 00:00:00 2001 From: Alexei Kasatkin Date: Fri, 23 May 2014 21:49:14 +0600 Subject: [PATCH 03/10] Avoid constexpr by #ifdef (not supported in MSVC18) --- Extractor/ExtractionContainers.h | 4 ++++ Util/TrigonometryTables.h | 1 + typedefs.h | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Extractor/ExtractionContainers.h b/Extractor/ExtractionContainers.h index e0c7a5394..a272387ea 100644 --- a/Extractor/ExtractionContainers.h +++ b/Extractor/ExtractionContainers.h @@ -37,7 +37,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. class ExtractionContainers { +#ifndef _MSC_VER constexpr static unsigned stxxl_memory = ((sizeof(std::size_t) == 4) ? std::numeric_limits::max() : std::numeric_limits::max()); +#else + const static unsigned stxxl_memory = ((sizeof(std::size_t) == 4) ? INT_MAX : UINT_MAX); +#endif public: typedef stxxl::vector STXXLNodeIDVector; typedef stxxl::vector STXXLNodeVector; diff --git a/Util/TrigonometryTables.h b/Util/TrigonometryTables.h index 665a397f8..d14540482 100644 --- a/Util/TrigonometryTables.h +++ b/Util/TrigonometryTables.h @@ -28,6 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef TRIGONOMETRY_TABLES_H #define TRIGONOMETRY_TABLES_H +#include "../typedefs.h" #include #include diff --git a/typedefs.h b/typedefs.h index c39cd1e63..ff1d2a157 100644 --- a/typedefs.h +++ b/typedefs.h @@ -35,7 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef M_PI #define M_PI 3.14159265358979323846 #endif - +#define constexpr const static #endif typedef unsigned int NodeID; From 3282d410c43c5aef30f99eaf3f96f9f3db22b961 Mon Sep 17 00:00:00 2001 From: alex85k Date: Mon, 7 Apr 2014 17:07:27 +0600 Subject: [PATCH 04/10] Add basic shared memory support for Windows OS --- DataStructures/SharedMemoryFactory.h | 143 +++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/DataStructures/SharedMemoryFactory.h b/DataStructures/SharedMemoryFactory.h index 818ad7baa..3223c083c 100644 --- a/DataStructures/SharedMemoryFactory.h +++ b/DataStructures/SharedMemoryFactory.h @@ -34,7 +34,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#ifndef WIN32 #include +#else +#include +#endif #ifdef __linux__ #include @@ -57,6 +61,7 @@ struct OSRMLockFile } }; +#ifndef WIN32 class SharedMemory { @@ -189,6 +194,144 @@ class SharedMemory boost::interprocess::mapped_region region; shm_remove remover; }; +#else +// Windows - specific code +class SharedMemory : boost::noncopyable +{ + //Remove shared memory on destruction + class shm_remove : boost::noncopyable + { + private: + char* m_shmid; + bool m_initialized; + public: + void SetID(char* shmid) + { + m_shmid = shmid; + m_initialized = true; + } + + shm_remove() : m_shmid("undefined"), m_initialized(false) {} + + ~shm_remove() + { + if(m_initialized) + { + SimpleLogger().Write(logDEBUG) << + "automatic memory deallocation"; + if(!boost::interprocess::shared_memory_object::remove(m_shmid)) + { + SimpleLogger().Write(logDEBUG) << "could not deallocate id " << m_shmid; + } + } + } + }; + + public: + void * Ptr() const + { + return region.get_address(); + } + + SharedMemory( + const boost::filesystem::path & lock_file, + const int id, + const uint64_t size = 0, + bool read_write = false, + bool remove_prev = true) + { + sprintf(key,"%s.%d","osrm.lock", id); + if( 0 == size ) + { //read_only + shm = boost::interprocess::shared_memory_object( + boost::interprocess::open_only, + key, + read_write ? boost::interprocess::read_write : boost::interprocess::read_only); + region = boost::interprocess::mapped_region ( + shm, read_write ? boost::interprocess::read_write : boost::interprocess::read_only); + } else + { //writeable pointer + //remove previously allocated mem + if( remove_prev ) + { + Remove(key); + } + shm = boost::interprocess::shared_memory_object ( + boost::interprocess::open_or_create, key, boost::interprocess::read_write); + shm.truncate(size); + region = boost::interprocess::mapped_region( shm, boost::interprocess::read_write); + + remover.SetID( key ); + SimpleLogger().Write(logDEBUG) << + "writeable memory allocated " << size << " bytes"; + } + } + + static bool RegionExists(const int id) + { + bool result = true; + try + { + char k[500]; + build_key(id, k); + result = RegionExists(k); + } catch(...) + { + result = false; + } + return result; + } + + static bool Remove(const int id) + { + char k[500]; + build_key(id, k); + return Remove(k); + } + + private: + static void build_key(int id, char* key) + { + OSRMLockFile lock_file; + sprintf(key,"%s.%d","osrm.lock", id); + } + static bool RegionExists(const char* key) + { + bool result = true; + try + { + boost::interprocess::shared_memory_object shm( + boost::interprocess::open_only, key, boost::interprocess::read_write); + } catch(...) + { + result = false; + } + return result; + } + + static bool Remove(char* key) + { + bool ret = false; + try + { + SimpleLogger().Write(logDEBUG) << "deallocating prev memory"; + ret = boost::interprocess::shared_memory_object::remove(key); + } catch(const boost::interprocess::interprocess_exception &e) + { + if(e.get_error_code() != boost::interprocess::not_found_error) + { + throw; + } + } + return ret; + } + + char key[500]; + boost::interprocess::shared_memory_object shm; + boost::interprocess::mapped_region region; + shm_remove remover; +}; +#endif template class SharedMemoryFactory_tmpl { From be5c3e41e1a2807681832926abf8fcc530d29032 Mon Sep 17 00:00:00 2001 From: alex85k Date: Thu, 5 Jun 2014 20:56:13 +0600 Subject: [PATCH 05/10] Replace sizeof asserts with warning on Windows --- prepare.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prepare.cpp b/prepare.cpp index 12149b4b4..98f0f475f 100644 --- a/prepare.cpp +++ b/prepare.cpp @@ -261,8 +261,12 @@ int main(int argc, char *argv[]) speed_profile.has_turn_penalty_function = lua_function_exists(lua_state, "turn_function"); + #ifdef WIN32 + #pragma message ("Memory consumption on Windows can be higher due to memory alignment") + #else static_assert(sizeof(ImportEdge) == 20, "changing ImportEdge type has influence on memory consumption!"); + #endif std::vector edge_list; NodeID number_of_node_based_nodes = readBinaryOSRMGraphFromStream(in, @@ -314,8 +318,10 @@ int main(int argc, char *argv[]) unsigned number_of_edge_based_nodes = edge_based_graph_factor->GetNumberOfEdgeBasedNodes(); BOOST_ASSERT(number_of_edge_based_nodes != std::numeric_limits::max()); DeallocatingVector edgeBasedEdgeList; + #ifndef WIN32 static_assert(sizeof(EdgeBasedEdge) == 16, "changing ImportEdge type has influence on memory consumption!"); + #endif edge_based_graph_factor->GetEdgeBasedEdges(edgeBasedEdgeList); std::vector node_based_edge_list; From 42d3ee9b94690e126490281a2c71a490507eae9d Mon Sep 17 00:00:00 2001 From: alex85k Date: Thu, 5 Jun 2014 21:02:33 +0600 Subject: [PATCH 06/10] workaround for std::packaged_task problem on MSVC --- routed.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routed.cpp b/routed.cpp index 7147bb18d..adf2e2dbc 100644 --- a/routed.cpp +++ b/routed.cpp @@ -142,7 +142,7 @@ int main(int argc, const char *argv[]) } else { - std::packaged_task server_task(std::bind(&Server::Run, routing_server)); + std::packaged_task server_task([&]()->int{ routing_server->Run(); return 0; }); auto future = server_task.get_future(); std::thread server_thread(std::move(server_task)); From c4998990e516d738c4f8229daf7e85f844836214 Mon Sep 17 00:00:00 2001 From: alex85k Date: Thu, 5 Jun 2014 21:08:31 +0600 Subject: [PATCH 07/10] disable io-benchmark on Windows --- Tools/io-benchmark.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tools/io-benchmark.cpp b/Tools/io-benchmark.cpp index 7373fa5bd..6304aaec0 100644 --- a/Tools/io-benchmark.cpp +++ b/Tools/io-benchmark.cpp @@ -79,6 +79,11 @@ int main(int argc, char *argv[]) SimpleLogger().Write() << "Not supported on FreeBSD"; return 0; #endif +#ifdef WIN32 + SimpleLogger().Write() << "Not supported on Windows"; + return 0; +#else + if (1 == argc) { @@ -339,4 +344,5 @@ int main(int argc, char *argv[]) return -1; } return 0; +#endif } From d0284991ed9d29581b2ec58d54735a51d4927a77 Mon Sep 17 00:00:00 2001 From: alex85k Date: Wed, 30 Apr 2014 14:30:51 +0600 Subject: [PATCH 08/10] patch Ruby files for successful testing on Windows --- features/support/data.rb | 6 +++--- features/support/env.rb | 7 +++++++ features/support/hash.rb | 8 ++++---- features/support/launch.rb | 22 +++++++++++++++++----- features/support/route.rb | 2 +- features/support/run.rb | 4 ++-- 6 files changed, 34 insertions(+), 15 deletions(-) diff --git a/features/support/data.rb b/features/support/data.rb index 58d5de759..7c1ba887a 100644 --- a/features/support/data.rb +++ b/features/support/data.rb @@ -217,7 +217,7 @@ def convert_osm_to_pbf unless File.exist?("#{@osm_file}.osm.pbf") log_preprocess_info log "== Converting #{@osm_file}.osm to protobuffer format...", :preprocess - unless system "osmosis --read-xml #{@osm_file}.osm --write-pbf #{@osm_file}.osm.pbf omitmetadata=true 1>>#{PREPROCESS_LOG_FILE} 2>>#{PREPROCESS_LOG_FILE}" + unless system "osmosis --read-xml #{@osm_file}.osm --write-pbf #{@osm_file}.osm.pbf omitmetadata=true >>#{PREPROCESS_LOG_FILE} 2>&1" raise OsmosisError.new $?, "osmosis exited with code #{$?.exitstatus}" end log '', :preprocess @@ -253,7 +253,7 @@ def extract_data Dir.chdir TEST_FOLDER do log_preprocess_info log "== Extracting #{@osm_file}.osm...", :preprocess - unless system "#{BIN_PATH}/osrm-extract #{@osm_file}.osm#{'.pbf' if pbf?} --profile #{PROFILES_PATH}/#{@profile}.lua 1>>#{PREPROCESS_LOG_FILE} 2>>#{PREPROCESS_LOG_FILE}" + unless system "#{BIN_PATH}/osrm-extract #{@osm_file}.osm#{'.pbf' if pbf?} --profile #{PROFILES_PATH}/#{@profile}.lua >>#{PREPROCESS_LOG_FILE} 2>&1" log "*** Exited with code #{$?.exitstatus}.", :preprocess raise ExtractError.new $?.exitstatus, "osrm-extract exited with code #{$?.exitstatus}." end @@ -265,7 +265,7 @@ def prepare_data Dir.chdir TEST_FOLDER do log_preprocess_info log "== Preparing #{@osm_file}.osm...", :preprocess - unless system "#{BIN_PATH}/osrm-prepare #{@osm_file}.osrm --profile #{PROFILES_PATH}/#{@profile}.lua 1>>#{PREPROCESS_LOG_FILE} 2>>#{PREPROCESS_LOG_FILE}" + unless system "#{BIN_PATH}/osrm-prepare #{@osm_file}.osrm --profile #{PROFILES_PATH}/#{@profile}.lua >>#{PREPROCESS_LOG_FILE} 2>&1" log "*** Exited with code #{$?.exitstatus}.", :preprocess raise PrepareError.new $?.exitstatus, "osrm-prepare exited with code #{$?.exitstatus}." end diff --git a/features/support/env.rb b/features/support/env.rb index b1eeb64b6..a6a9ca00e 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -44,6 +44,13 @@ unless File.exists? TEST_FOLDER raise "*** Test folder #{TEST_FOLDER} doesn't exist." end +if ENV['OS']=~/Windows.*/ then + EXE='.exe' + QQ='"' +else + EXE='' + QQ='' +end AfterConfiguration do |config| clear_log_files diff --git a/features/support/hash.rb b/features/support/hash.rb index 6381af62d..197cd426e 100644 --- a/features/support/hash.rb +++ b/features/support/hash.rb @@ -7,7 +7,7 @@ def hash_of_files paths paths = [paths] unless paths.is_a? Array hash = Digest::SHA1.new for path in paths do - open(path,'r') do |io| + open(path,'rb') do |io| while !io.eof buf = io.readpartial 1024 hash.update buf @@ -32,15 +32,15 @@ def lua_lib_hash end def bin_extract_hash - bin_extract_hash ||= hash_of_files "#{BIN_PATH}/osrm-extract" + bin_extract_hash ||= hash_of_files "#{BIN_PATH}/osrm-extract#{EXE}" end def bin_prepare_hash - bin_prepare_hash ||= hash_of_files "#{BIN_PATH}/osrm-prepare" + bin_prepare_hash ||= hash_of_files "#{BIN_PATH}/osrm-prepare#{EXE}" end def bin_routed_hash - bin_routed_hash ||= hash_of_files "#{BIN_PATH}/osrm-routed" + bin_routed_hash ||= hash_of_files "#{BIN_PATH}/osrm-routed#{EXE}" end #combine state of data, profile and binaries into a hash that identifies the exact test scenario diff --git a/features/support/launch.rb b/features/support/launch.rb index 6699fb947..e55867a67 100644 --- a/features/support/launch.rb +++ b/features/support/launch.rb @@ -1,6 +1,12 @@ require 'socket' require 'open3' +if ENV['OS']==/Windows.*/ then + TERMSIGNAL='TERM' +else + TERMSIGNAL=9 +end + OSRM_ROUTED_LOG_FILE = 'osrm-routed.log' class OSRMBackgroundLauncher @@ -39,9 +45,15 @@ class OSRMBackgroundLauncher def osrm_up? if @pid - `ps -o state -p #{@pid}`.split[1].to_s =~ /^[DRST]/ - else - false + begin + if Process.waitpid(@pid, Process::WNOHANG) then + false + else + true + end + rescue Errno::ESRCH, Errno::ECHILD + false + end end end @@ -53,7 +65,7 @@ class OSRMBackgroundLauncher def osrm_down if @pid - Process.kill 'TERM', @pid + Process.kill TERMSIGNAL, @pid wait_for_shutdown end end @@ -67,7 +79,7 @@ class OSRMBackgroundLauncher def wait_for_connection while true begin - socket = TCPSocket.new('localhost', OSRM_PORT) + socket = TCPSocket.new('127.0.0.1', OSRM_PORT) return rescue Errno::ECONNREFUSED sleep 0.1 diff --git a/features/support/route.rb b/features/support/route.rb index 2f930751e..a88216b7e 100644 --- a/features/support/route.rb +++ b/features/support/route.rb @@ -1,6 +1,6 @@ require 'net/http' -HOST = "http://localhost:#{OSRM_PORT}" +HOST = "http://127.0.0.1:#{OSRM_PORT}" DESTINATION_REACHED = 15 #OSRM instruction code class Hash diff --git a/features/support/run.rb b/features/support/run.rb index 236c873d9..794050a32 100644 --- a/features/support/run.rb +++ b/features/support/run.rb @@ -10,8 +10,8 @@ def run_bin bin, options if opt.include? '{profile}' opt.gsub! "{profile}", "#{PROFILES_PATH}/#{@profile}.lua" end - - @stdout = `#{BIN_PATH}/#{bin} #{opt} 2>error.log` + + @stdout = `#{QQ}#{BIN_PATH}/#{bin}#{EXE}#{QQ} #{opt} 2>error.log` @stderr = File.read 'error.log' @exit_code = $?.exitstatus end From 4e7ccaa298b5b656e162345394f95bdb26e9392a Mon Sep 17 00:00:00 2001 From: alex85k Date: Fri, 6 Jun 2014 16:28:56 +0600 Subject: [PATCH 09/10] use std::memcpy instead of std::copy (avoid checked iterators assertions) --- Util/FingerPrint.cpp.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Util/FingerPrint.cpp.in b/Util/FingerPrint.cpp.in index d106a99dd..d1ce4f06c 100644 --- a/Util/FingerPrint.cpp.in +++ b/Util/FingerPrint.cpp.in @@ -50,13 +50,13 @@ FingerPrint::FingerPrint() : magic_number(1297240911) std::string temp_string(__DATE__); temp_string += __TIME__; - std::copy(MD5PREPARE, MD5PREPARE + strlen(MD5PREPARE), md5_prepare); + std::memcpy(md5_prepare, MD5PREPARE, strlen(MD5PREPARE)); temp_string += md5_prepare; - std::copy(MD5RTREE, MD5RTREE + 32, md5_tree); + std::memcpy(md5_tree, MD5RTREE, 32); temp_string += md5_tree; - std::copy(MD5GRAPH, MD5GRAPH + 32, md5_graph); + std::memcpy(md5_graph, MD5GRAPH, 32); temp_string += md5_graph; - std::copy(MD5OBJECTS, MD5OBJECTS + 32, md5_objects); + std::memcpy(md5_objects, MD5OBJECTS, 32); temp_string += md5_objects; named_uuid = gen(temp_string); From f1bde409392377343a69f61a55fc3d560bef39ef Mon Sep 17 00:00:00 2001 From: alex85k Date: Fri, 6 Jun 2014 17:09:46 +0600 Subject: [PATCH 10/10] add appveyor.yml template --- appveyor.yml | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..f992a07a4 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,61 @@ +environment: + matrix: + - configuration: Debug + - configuration: Release + +# branches to build +branches: + # whitelist + only: + - win-038 +# - develop +#TODO: replace with develop branch when merged + +# Operating system (build VM template) +os: Windows Server 2012 R2 + +# scripts that are called at very beginning, before repo cloning +init: + - git config --global core.autocrlf input + +# clone directory +clone_folder: c:\projects\osrm + +platform: x64 + +install: + # by default, all script lines are interpreted as batch + - cd c:\projects\osrm + - curl -O http://build.project-osrm.org/libs_osrm_%Configuration%.7z + - 7z x libs_osrm_%Configuration%.7z | find ":" + +build_script: + - cd c:/projects/osrm + - mkdir build + - cd build + - echo Running cmake... + - call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 + - SET P=c:/projects/osrm + - set TBB_INSTALL_DIR=%P%/tbb + - set TBB_ARCH_PLATFORM=intel64/vc12 + - cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%Configuration% -DBZIP2_INCLUDE_DIR=%P%/libs/include -DBZIP2_LIBRARIES=%P%/libs/lib/libbz2.lib -DCMAKE_INSTALL_PREFIX=%P%/libs -DBOOST_ROOT=%P%/boost_min -DBoost_USE_STATIC_LIBS=ON + - nmake + - 7z a %P%/osrm_%Configuration%.zip *.exe *.pdb %P%/libs/bin/*.dll -tzip + +test: off + +artifacts: + - path: osrm_Debug.zip + name: osrm_Debug.zip + - path: osrm_Release.zip + name: osrm_Release.zip + +#deploy: +# provider: FTP +# server: ftp.mample.com +# username: user +# password: +# secure: XMdn4xfPcYlZFYgvbytc8Q== +# folder: osrm +# enable_ssl: true|false (disabled by default) +# artifact: /.*\.zip/