Skip to content

Commit

Permalink
Fix C++11 build. Enable C++11 in Travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
est77 committed Nov 22, 2016
1 parent e7e26ad commit f1993ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ matrix:
compiler: gcc
env: GCC_VERSION=5 USE_CPP11=OFF

# - os: linux
# compiler: gcc
# env: GCC_VERSION=4.8 USE_CPP11=ON
- os: linux
compiler: gcc
env: GCC_VERSION=4.8 USE_CPP11=ON

# - os: linux
# compiler: gcc
# env: GCC_VERSION=5 USE_CPP11=ON
- os: linux
compiler: gcc
env: GCC_VERSION=5 USE_CPP11=ON

script:
- ./travis/build.sh
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ find_package (Boost 1.55 REQUIRED ${BOOST_NEEDED_LIBS})

add_definitions (-DBOOST_FILESYSTEM_VERSION=3 -DBOOST_FILESYSTEM_NO_DEPRECATED)

if (USE_CPP11)
# Workaround for undefined reference to boost::filesystem::detail::copy_file
# link error when building in C++11 mode.
add_definitions (-DBOOST_NO_CXX11_SCOPED_ENUMS)
endif ()

include_directories (SYSTEM ${Boost_INCLUDE_DIRS})
link_directories (${Boost_LIBRARY_DIRS})

Expand Down
2 changes: 1 addition & 1 deletion src/appleseed.cli/continuoussavingtilecallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace
: ProgressTileCallback(logger)
, m_output_path(output_path)
{
mt19937 rng(static_cast<uint32_t>(time(0)));
boost::mt19937 rng(static_cast<uint32_t>(time(0)));
const uuids::uuid u = uuids::basic_random_generator<boost::mt19937>(&rng)();
const bf::path ext = m_output_path.extension();
const string tmp_filename = uuids::to_string(u) + ext.string();
Expand Down

0 comments on commit f1993ae

Please sign in to comment.