Skip to content

Commit

Permalink
Merge pull request #543 from dartsim/appveyor_msvc_default_options
Browse files Browse the repository at this point in the history
Add cmake option DART_MSVC_DEFAULT_OPTIONS for Visual Studio build
  • Loading branch information
jslee02 committed Nov 6, 2015
2 parents 7ee9bc3 + 49b8d7b commit 2f49a25
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -465,14 +466,16 @@ 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_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")
endif(NOT DART_MSVC_DEFAULT_OPTIONS)
elseif(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-Wall -msse2 -fPIC")
execute_process(
Expand Down
7 changes: 4 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ platform:

# specify custom environment variables
environment:
MSVC_DEFAULT_OPTIONS: ON
BOOST_ROOT: C:\Libraries\boost
BOOST_LIBRARYDIR: C:\Libraries\boost\stage\lib
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:
Expand Down Expand Up @@ -43,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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion unittests/testSignal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f49a25

Please sign in to comment.