From b4b43935201fef012c7607379e3ee72ad256354b Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 28 Oct 2015 13:36:56 -0400 Subject: [PATCH 1/6] Add option to build with MSVC default options (flags) --- CMakeLists.txt | 10 ++++++---- appveyor.yml | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bbc629af3cc40..32339c7572192 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,7 @@ option(BUILD_CORE_ONLY "Build only the core of DART" OFF) if(MSVC) set(DART_RUNTIME_LIBRARY "/MD" CACHE STRING "BaseName chosen by the user at CMake configure time") set_property(CACHE DART_RUNTIME_LIBRARY PROPERTY STRINGS /MD /MT) + option(DART_MSVC_DEFAULT_OPTIONS "Build DART with default Visual Studio options" OFF) else() option(BUILD_SHARED_LIBS "Build shared libraries" ON) endif() @@ -420,14 +421,15 @@ endif() # Compiler flags #=============================================================================== if(MSVC) - message(STATUS "Setup Visual Studio Specific Flags") # Visual Studio enables c++11 support by default if(NOT MSVC12) message(FATAL_ERROR "${PROJECT_NAME} requires VS 2013 or greater.") endif() - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DART_RUNTIME_LIBRARY}d /Zi /Gy /W1 /EHsc") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${DART_RUNTIME_LIBRARY} /Zi /GL /Gy /W1 /EHsc /arch:SSE2") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO") + if(NOT DART_MSVC_DEFAULT_OPTIONS) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DART_RUNTIME_LIBRARY}d /Zi /Gy /W1 /EHsc") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${DART_RUNTIME_LIBRARY} /Zi /GL /Gy /W1 /EHsc /arch:SSE2") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO") + endif(NOT DART_MSVC_DEFAULT_OPTIONS) elseif(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "-Wall -msse2 -fPIC") execute_process( diff --git a/appveyor.yml b/appveyor.yml index 8ada23ea80804..69e229bbc1dbd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,6 +11,7 @@ platform: # specify custom environment variables environment: + MSVC_DEFAULT_OPTIONS: ON BOOST_ROOT: C:\Libraries\boost BOOST_LIBRARYDIR: C:\Libraries\boost\stage\lib BUILD_EXAMPLES: OFF # don't build examples to not exceed allowed build time (40 min) @@ -54,7 +55,7 @@ before_build: # We generate project files for Visual Studio 12 because the boost binaries installed on the test server are for Visual Studio 12. - cmd: if "%platform%"=="Win32" set CMAKE_GENERATOR_NAME=Visual Studio 12 - cmd: if "%platform%"=="x64" set CMAKE_GENERATOR_NAME=Visual Studio 12 Win64 - - cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_CORE_ONLY="%BUILD_CORE_ONLY%" -DDART_BUILD_EXAMPLES="%BUILD_EXAMPLES%" -DDART_BUILD_TUTORIALS="%BUILD_TUTORIALS%" -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBoost_USE_STATIC_LIBS="ON" -Durdfdom_DIR="%urdfdom_DIR%" -Durdfdom_headers_DIR="%urdfdom_headers_DIR%" .. + - cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_CORE_ONLY="%BUILD_CORE_ONLY%" -DDART_BUILD_EXAMPLES="%BUILD_EXAMPLES%" -DDART_BUILD_TUTORIALS="%BUILD_TUTORIALS%" -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBoost_USE_STATIC_LIBS="ON" -Durdfdom_DIR="%urdfdom_DIR%" -Durdfdom_headers_DIR="%urdfdom_headers_DIR%" -DDART_MSVC_DEFAULT_OPTIONS="%MSVC_DEFAULT_OPTIONS%" .. build: project: C:\projects\dart\build\dart.sln # path to Visual Studio solution or project From 0d2425ecec9181ecd7d6503a7dd8be4ad25d7734 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 28 Oct 2015 16:17:59 -0400 Subject: [PATCH 2/6] Enable parallel build for MSVC --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32339c7572192..7695c4d6b26b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -425,6 +425,7 @@ if(MSVC) if(NOT MSVC12) message(FATAL_ERROR "${PROJECT_NAME} requires VS 2013 or greater.") endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP4") if(NOT DART_MSVC_DEFAULT_OPTIONS) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DART_RUNTIME_LIBRARY}d /Zi /Gy /W1 /EHsc") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${DART_RUNTIME_LIBRARY} /Zi /GL /Gy /W1 /EHsc /arch:SSE2") From 207636224b9dd3f482c50af5d2907c929fe01299 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 28 Oct 2015 18:44:14 -0400 Subject: [PATCH 3/6] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7695c4d6b26b8..ffeaabe699a85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -426,10 +426,10 @@ if(MSVC) message(FATAL_ERROR "${PROJECT_NAME} requires VS 2013 or greater.") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP4") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO") if(NOT DART_MSVC_DEFAULT_OPTIONS) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DART_RUNTIME_LIBRARY}d /Zi /Gy /W1 /EHsc") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${DART_RUNTIME_LIBRARY} /Zi /GL /Gy /W1 /EHsc /arch:SSE2") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO") endif(NOT DART_MSVC_DEFAULT_OPTIONS) elseif(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "-Wall -msse2 -fPIC") From 9adad4381a277430f14c53d19231ee9eac37849a Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Tue, 3 Nov 2015 02:51:45 -0500 Subject: [PATCH 4/6] Relax error tolerance in signal test --- unittests/testSignal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/testSignal.cpp b/unittests/testSignal.cpp index 170f580c3bb16..3583de0b18c7d 100644 --- a/unittests/testSignal.cpp +++ b/unittests/testSignal.cpp @@ -241,7 +241,7 @@ struct signal_sum //============================================================================== TEST(Signal, ReturnValues) { - const float tol = 1e-6; + const float tol = 1.5e-6; const float a = 5.0f; const float b = 3.0f; From 7969f2d4825826244427379cad3a502893aefa0a Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 5 Nov 2015 12:34:51 -0500 Subject: [PATCH 5/6] Update boost paths --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 69e229bbc1dbd..f1fad0c2eac35 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,8 +12,8 @@ platform: # specify custom environment variables environment: MSVC_DEFAULT_OPTIONS: ON - BOOST_ROOT: C:\Libraries\boost - BOOST_LIBRARYDIR: C:\Libraries\boost\stage\lib + BOOST_ROOT: "C:\\Libraries\\boost" + BOOST_LIBRARYDIR: "C:\\Libraries\\boost\\lib32-msvc-12.0" BUILD_EXAMPLES: OFF # don't build examples to not exceed allowed build time (40 min) BUILD_TUTORIALS: OFF # don't build tutorials to not exceed allowed build time (40 min) matrix: From 49b8d7bc42e8c0309a08168d3f534780ebc6e90b Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 5 Nov 2015 15:08:21 -0500 Subject: [PATCH 6/6] Use consistent path style --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f1fad0c2eac35..38f6ebdbe3460 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,8 +12,8 @@ platform: # specify custom environment variables environment: MSVC_DEFAULT_OPTIONS: ON - BOOST_ROOT: "C:\\Libraries\\boost" - BOOST_LIBRARYDIR: "C:\\Libraries\\boost\\lib32-msvc-12.0" + BOOST_ROOT: C:\Libraries\boost + BOOST_LIBRARYDIR: C:\Libraries\boost\lib32-msvc-12.0 BUILD_EXAMPLES: OFF # don't build examples to not exceed allowed build time (40 min) BUILD_TUTORIALS: OFF # don't build tutorials to not exceed allowed build time (40 min) matrix: @@ -44,7 +44,7 @@ branches: # scripts that run after cloning repository install: - - ps: cd "C:\projects\dart\ci" + - ps: cd C:\projects\dart\ci - ps: .\appveyor_install.ps1 # scripts to run before build