Skip to content

Commit

Permalink
Update build scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsy committed Jul 12, 2018
1 parent 60538b4 commit 44057af
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 172 deletions.
31 changes: 31 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
image: Visual Studio 2017

platform:
- x86
- x64

configuration:
- Debug
- Release

install:
- mkdir build
- cd build

build_script:
- if %platform%==x86 set generator=Visual Studio 15 2017
- if %platform%==x64 set generator=Visual Studio 15 2017 Win64
- cmake -G "%generator%" -D CMAKE_BUILD_TYPE="%configuration%" -D SPICA_BUILD_MAIN=ON -D WITH_SSE=ON ..

branches:
only:
- master
- development

notifications:
- provider: Email
to:
- tatsy.mail@gmail.com
on_build_success: false
on_build_failure: true
on_build_status_changed: true
18 changes: 0 additions & 18 deletions .appvoyer.yml

This file was deleted.

24 changes: 9 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ before_install:
# Install required packages
- sudo apt -qq update
# - sudo apt -qq upgrade
- sudo apt -qq install build-essential software-properties-common cmake
- sudo apt -qq install build-essential software-properties-common cmake lcov
- sudo apt -qq install byobu curl wget git htop man unzip vim wget subversion
- if [ $TRAVIS_BRANCH = "master" ]; then sudo apt-get -qq install doxygen; fi

# Install gcc/g++ v7
- sudo add-apt-repository -yy ppa:ubuntu-toolchain-r/test
- sudo apt update
- sudo apt -qq update
- sudo apt install -qq gcc-7 g++-7
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
- gcc --version
Expand All @@ -26,24 +26,19 @@ before_install:
- mkdir googletest/build && cd googletest/build
- cmake -D CMAKE_BUILD_TYPE=Release .. && make -j4
- sudo make install
- cd ../../

# Install Gcovr
- sudo apt-get -qq install python-pip ruby
- pip install gcovr
- gem install coveralls-lcov
- sudo pip install gcovr
- sudo gem install coveralls-lcov

install:
# Build
- mkdir build && cd build
- cmake -D CMAKE_BUILD_TYPE=Release -D SPICA_BUILD_MAIN=ON -D SPICA_BUILD_TESTS=ON -WITH_SSE=ON ..
- cmake -D CMAKE_BUILD_TYPE=Release -D SPICA_BUILD_MAIN=ON -D SPICA_BUILD_TESTS=ON -D WITH_SSE=ON ..
- cmake --build .

# Dynamically generate Dockerfile
- sed -i -e "s/@C_COMPILER@/$CC/;s/@CXX_COMPILER@/$CXX/;s/@BRANCH_NAME@/$TRAVIS_BRANCH/;s/@PULL_REQUEST@/$TRAVIS_PULL_REQUEST/" Dockerfile

# Build Dockerfile
- docker build --tag=spica-env .

before_script:
- lcov --directory . --zerocounters

Expand All @@ -53,9 +48,8 @@ script:

after_success:
## Collect coverage data
- if [ $CXX = "g++" ]; then docker exec spica-env lcov --directory . --capture --output-file coverage.info; fi
- if [ $CXX = "clang++" ]; then docker exec spica-env lcov --directory . --capture --output-file coverage.info; fi
- lcov --remove coverage.info '3rdparty/*' 'sources/renderer/*' 'sources/viewer/*' 'tests/*' '/usr/*' 'CMakeFiles/*' --output-file coverage.info
- lcov --directory . --capture --output-file coverage.info
- lcov --remove coverage.info 'tests/*' '/usr/*' 'CMakeFiles/*' --output-file coverage.info
- lcov --list coverage.info
- coveralls-lcov --repo-token RiYcPJSCbPZoogMd1PE10696EAqG8sl5q coverage.info

Expand All @@ -76,7 +70,7 @@ deploy:
- packages/releases-$TRAVIS_TAG.zip
on:
tags: true
condition: $CXX=clang++
condition: $CXX=g++

branches:
only:
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
cmake_minimum_required(VERSION 3.6.0 FATAL_ERROR)
project(spica)

include(cmake/SpicaConfig.cmake)
Expand Down Expand Up @@ -28,6 +28,8 @@ if (NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -pthread")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lstdc++fs")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lstdc++fs")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lstdc++fs")
set(CMAKE_FS_LIBS "stdc++fs")

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
Expand Down
78 changes: 0 additions & 78 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2016 Tatsuya Yatagawa (tatsy)
Copyright (c) 2015-2018 Tatsuya Yatagawa (tatsy)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
41 changes: 0 additions & 41 deletions Makefile

This file was deleted.

25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,31 @@ spica

[![License](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
[![Build Status](https://travis-ci.org/tatsy/spica.svg?branch=master)](https://travis-ci.org/tatsy/spica)
[![Build status](https://ci.appveyor.com/api/projects/status/qs0h81nea6hcr1ti?svg=true)](https://ci.appveyor.com/project/tatsy/spica)
[![Coverage Status](https://coveralls.io/repos/tatsy/spica/badge.svg?branch=master)](https://coveralls.io/r/tatsy/spica?branch=master)

> **spica** is a cross-platform physically-based renderer.
> The project is maintained to be light-weight. All the dependencies
> can be installed as a Git's submodule system!
## Installation

#### Build

This project uses C++11/14. The build is tested under following environments.
This project uses C++17. The build is tested under following environments.

* GNU C compiler (v4.9.0 or higher)
* LLVM Clang (v3.7.0 or higher)
* Xcode 8.0
* Microsoft Visual C++ compiler (MSVC 2015)

#### Requirements

The spica renderer depends on Qt (version 5.5 or higher) for parsing XML
files and launching GUI.
* GNU C compiler (v7.3.0 or higher)
* Microsoft Visual C++ compiler (MSVC 2017)

#### Command

```shell
$ git clone https://github.com/tatsy/spica.git
$ cmake [-DSPICA_BUILD_VIEWER=ON/OFF] ..
$ git clone --depth=10 https://github.com/tatsy/spica.git
$ git submodule update --init --recursive
$ mkdir build && cd build
$ cmake -D CMAKE_BUILD_TYPE=Release -D SPICA_BUILD_MAIN=ON [-D WITH_SSE=ON] ..
$ cmake --build .
$ make install
```

## Results
Expand Down Expand Up @@ -70,4 +69,4 @@ The author sincerely would also like to thank for HDR images provided by sIBL Ar

## License

The MIT License (MIT). Copyright (c) 2015-2017 Tatsuya Yatagawa (tatsy).
The MIT License (MIT). Copyright (c) 2015-2018 Tatsuya Yatagawa (tatsy).
6 changes: 3 additions & 3 deletions cmake/SpicaConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ macro(add_spica_corelib _corelib_name)
endif()

if (_corelib_LINK_LIBRARIES)
target_link_libraries(${_corelib_name} ${_corelib_LINK_LIBRARIES})
target_link_libraries(${_corelib_name} ${_corelib_LINK_LIBRARIES} ${CMAKE_FS_LIBS} ${CMAKE_DL_LIBS})
add_dependencies(${_corelib_name} ${_corelib_LINK_LIBRARIES})
endif()

Expand Down Expand Up @@ -107,8 +107,8 @@ macro(add_spica_plugin _plugin_name)

# Link setting
set(_plugin_core_libraries "${SPICA_PREFIX}_core")
target_link_libraries(${_plugin_name} ${_plugin_core_libraries})
target_link_libraries(${_plugin_name} ${_plugin_LINK_LIBRARIES})
target_link_libraries(${_plugin_name} ${_plugin_core_libraries} ${CMAKE_FS_LIBS} ${CMAKE_DL_LIBS})
target_link_libraries(${_plugin_name} ${_plugin_LINK_LIBRARIES} ${CMAKE_FS_LIBS} ${CMAKE_DL_LIBS})

# Folder setting
set(_plugin_FOLDER "plugins")
Expand Down
2 changes: 1 addition & 1 deletion sources/spica/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ file(GLOB SOURCE_FILES "*.cc" "*.h")

add_executable(${SPICA_MAIN} ${SOURCE_FILES} ${SUBMODULE_SOURCE_FILES})
add_dependencies(${SPICA_MAIN} ${SPICA_LIBCORE} ${SPICA_LIBRENDER})
target_link_libraries(${SPICA_MAIN} ${SPICA_LIBCORE})
target_link_libraries(${SPICA_MAIN} ${SPICA_LIBCORE} ${CMAKE_FS_LIBS} ${CMAKE_DL_LIBS})

source_group("Source Files" FILES ${SOURCE_FILES} ${SUBMODULE_SOURCE_FILES})

Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (${SPICA_BUILD_TESTS})
target_link_libraries(${TEST_NAME} ${SPICA_LIBCORE})

if (LINUX)
target_link_libraries(${TEST_NAME} ${CMAKE_DL_LIBS})
target_link_libraries(${TEST_NAME} ${CMAKE_FS_LIBS} ${CMAKE_DL_LIBS})
endif()

if (MSVC)
Expand Down

0 comments on commit 44057af

Please sign in to comment.