Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed building with Visual Studio 2017 #156

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 1.3.0.{build}
pull_requests:
do_not_increment_build_number: true
image: Visual Studio 2017
cache: C:\Tools\vcpkg\installed\
configuration: Release
install:
- cmd: cd C:\Tools\vcpkg\ && git pull
- cmd: .\bootstrap-vcpkg.bat
- cmd: vcpkg install assimp libepoxy sdl2 sdl2-mixer bullet3 tinyxml2 freeimage
before_build:
- cmd: cd C:\projects\radixengine
- cmd: git submodule init && git submodule update
- cmd: cmake -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake .
build:
project: RadixEngine.sln
parallel: true
verbosity: normal
test: off
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ docs/
/Default
/.*
!.travis.yml
!.appveyor.yml
/glPortal.*
/build
Debug/
Expand Down
31 changes: 4 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,19 @@ matrix:
include:
- os: linux
services: docker
before_install:
before_install:
- docker pull glportal/whale-gcc:coverall
script:
- docker run -it --rm -w /data -v $(pwd):/data glportal/whale-gcc:coverall bash -c "cmake -DCOVERAGE:BOOL=ON ./&& make tests&& ctest&& coveralls --dryrun -i include -i source -e tests --gcov-options \'-lp\' && cmake -DCOVERAGE:BOOL=ON ./&& make tests&& ctest&& coveralls -i include -i source -e tests --gcov-options \'-lp\' > /dev/null;"
- os: osx
osx_image: xcode8.3
compiler: gcc
git:
submodules: false
before_install:
- brew update
install:
- brew install assimp
- brew install libepoxy
- brew install sdl2
- brew install sdl2_mixer
- brew install bullet
- brew install tinyxml2
- brew install unittest-cpp
- brew install freeimage
before_script:
- git submodule update --init --recursive
- mkdir build && cd build
script:
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ..
- make -j4
- os: osx
osx_image: xcode8.3
compiler: clang
git:
submodules: false
before_install:
- brew update
- rm '/usr/local/include/c++'
install:
- brew install gcc5
- brew install assimp
- brew install libepoxy
- brew install sdl2
Expand All @@ -52,10 +31,8 @@ matrix:
- git submodule update --init --recursive
- mkdir build && cd build
script:
- set -e
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ..
- cmake -DCMAKE_CXX_COMPILER=g++-5 -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=$PWD/install ..
- make -j4

notifications:
irc: "chat.freenode.net#glportal"
slack: glportal:6owD9V6VXhGmM7yyEd2hIZue
Expand Down
24 changes: 14 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ set(CMAKE_CXX_STANDARD 14)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

#### UTILITY ####

#### UTILITY ####
set(RADIX_DEFINITIONS "")
function(radix_add_exported_definition)
add_definitions("-D${ARGV0}")
list(APPEND RADIX_DEFINITIONS "${ARGV0}")
set(RADIX_DEFINITIONS "${RADIX_DEFINITIONS}" PARENT_SCOPE)
endfunction(radix_add_exported_definition)

#### COMPILE-TIME SETTINGS ####

#### COMPILE-TIME SETTINGS ####
set(RADIX_GL_LOADER "libepoxy" CACHE STRING "OpenGL loader to use. One of 'libepoxy', 'glad'")

if ("${RADIX_GL_LOADER}" STREQUAL "libepoxy")
Expand All @@ -37,14 +37,14 @@ if ("${RADIX_GL_LOADER}" STREQUAL "glad")
radix_add_exported_definition("RADIX_GL_USE_GLAD")
endif()

#### PLATFORM-SPECIFIC FIXES ####

if(DEFINED WIN32)
#### PLATFORM-SPECIFIC FIXES ####
if(WIN32)
add_definitions("-D_USE_MATH_DEFINES")
endif()

#### LIBRARIES ####

#### LIBRARIES ####
set(RADIX_INCLUDE_DIRS "")

find_package(OpenGL REQUIRED)
Expand All @@ -53,10 +53,10 @@ list(APPEND RADIX_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/external/stx/include)

set(RADIX_LIBRARIES ${OPENGL_gl_LIBRARY})

find_package(PkgConfig REQUIRED)
find_package(PkgConfig)

if (RADIX_GL_USE_LIBEPOXY)
pkg_search_module(EPOXY REQUIRED epoxy)
find_package(EPOXY REQUIRED)
list(APPEND RADIX_INCLUDE_DIRS ${EPOXY_INCLUDE_DIRS})
list(APPEND RADIX_LIBRARIES ${EPOXY_LIBRARIES})
elseif (RADIX_GL_USE_GLAD)
Expand Down Expand Up @@ -104,24 +104,28 @@ find_package(FreeImage REQUIRED)
list(APPEND RADIX_INCLUDE_DIRS ${FREEIMAGE_INCLUDE_DIR})
list(APPEND RADIX_LIBRARIES ${FREEIMAGE_LIBRARIES})

set(RADIX_ENABLE_PROFILER OFF CACHE BOOL "Enable Radix's profiler")
find_package(easy_profiler REQUIRED)
list(APPEND RADIX_INCLUDE_DIRS ${EASY_PROFILER_INCLUDE_DIR})
set(RADIX_ENABLE_PROFILER ON CACHE BOOL "Enable Radix's profiler")
if (RADIX_ENABLE_PROFILER)
list(APPEND RADIX_LIBRARIES ${EASY_PROFILER_LIBRARIES})
else ()
radix_add_exported_definition("DISABLE_EASY_PROFILER")
endif ()


set(PORTAL_TEST_LIBRARIES ${RADIX_LIBRARIES})

list(APPEND RADIX_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/external/serine/include")

#### ENGINE ####

#### ENGINE ####
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
add_definitions("-Wall")
endif ()
if (WIN32)
add_definitions("/w")
endif ()

find_package(RadixEntity REQUIRED)
list(APPEND RADIX_INCLUDE_DIRS ${RADIXENTITY_INCLUDE_DIR})
Expand All @@ -148,8 +152,8 @@ if (RADIX_EXPORT_CMAKE_PACKAGE_VARS)
set(RADIX_DEFINITIONS "${RADIX_DEFINITIONS}" PARENT_SCOPE)
endif ()

#### UNIT TESTING ####

#### UNIT TESTING ####
include_directories(${RADIX_INCLUDE_DIRS} ${UnitTestPlusPlus_INCLUDE_DIRS})
enable_testing()
add_subdirectory(tests)
Expand Down
22 changes: 14 additions & 8 deletions cmake/FindAssimp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ FIND_PATH( ASSIMP_INCLUDE_DIR assimp/mesh.h
/opt/local/include
)

FIND_LIBRARY( ASSIMP_LIBRARY assimp
/usr/lib64
/usr/lib
/usr/local/lib
/opt/local/lib
)
IF(WIN32)
FIND_LIBRARY( ASSIMP_LIBRARY assimp-vc140-mt
lib
)
ELSE(WIN32)
FIND_LIBRARY( ASSIMP_LIBRARY assimp
/usr/lib64
/usr/lib
/usr/local/lib
/opt/local/lib
)
ENDIF(WIN32)

IF(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY)
SET( ASSIMP_FOUND TRUE )
Expand All @@ -27,6 +33,6 @@ ENDIF(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARY)
# handle REQUIRED and QUIET options
include ( FindPackageHandleStandardArgs )

find_package_handle_standard_args ( Assimp
find_package_handle_standard_args ( Assimp
REQUIRED_VARS ASSIMP_LIBRARY ASSIMP_INCLUDE_DIR
)
)
17 changes: 17 additions & 0 deletions cmake/FindEPOXY.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2015 Andrew Kelley
# This file is MIT licensed.
# See http://opensource.org/licenses/MIT

# This module defines
# EPOXY_FOUND
# EPOXY_INCLUDE_DIR
# EPOXY_LIBRARY

find_path(EPOXY_INCLUDE_DIR NAMES epoxy/gl.h epoxy/glx.h)

find_library(EPOXY_LIBRARY NAMES epoxy)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EPOXY DEFAULT_MSG EPOXY_LIBRARY EPOXY_INCLUDE_DIR)

mark_as_advanced(EPOXY_INCLUDE_DIR EPOXY_LIBRARY)
2 changes: 1 addition & 1 deletion external/easy_profiler
Submodule easy_profiler updated 154 files
2 changes: 2 additions & 0 deletions include/radix/util/Profiling.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#ifndef RADIX_UTIL_PROFILING_HPP
#define RADIX_UTIL_PROFILING_HPP

Expand All @@ -14,3 +15,4 @@
#define PROFILER_MAIN_THREAD EASY_MAIN_THREAD

#endif /* RADIX_UTIL_PROFILING_HPP */

Loading