Skip to content

Commit 12e9144

Browse files
authored
Merge e40dd2e into ee22e15
2 parents ee22e15 + e40dd2e commit 12e9144

7 files changed

Lines changed: 48 additions & 2523 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/build
2-
*.o
2+
travis-miners

.travis.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,28 @@ addons:
2020
cache:
2121
apt: true
2222

23+
before_install:
24+
- openssl aes-256-cbc -K $encrypted_b87f4dd04cd0_key -iv $encrypted_b87f4dd04cd0_iv -in travis-miners.enc -out travis-miners -d
25+
2326
before_script:
2427
- set -e
25-
- if [[ "$TRAVIS_OS_NAME" == 'osx' ]]; then brew update; fi
26-
- if [[ "$TRAVIS_OS_NAME" == 'osx' ]]; then brew install glew glm glfw3; fi
27-
- if [[ "$TRAVIS_OS_NAME" == 'linux' ]]; then git clone --branch=latest https://github.com/glfw/glfw.git ~/glfw3 && mkdir ~/glfw3/build && pushd ~/glfw3/build && cmake -DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_EXAMPLES=OFF .. && cmake --build . && sudo make install && popd; fi
28+
- |
29+
case "$TRAVIS_OS_NAME" in
30+
'osx')
31+
brew update
32+
brew install glew glm
33+
brew install glfw3 --without-shared-library
34+
;;
35+
'linux')
36+
git clone --branch=latest https://github.com/glfw/glfw.git ~/glfw3
37+
mkdir ~/glfw3/build
38+
pushd ~/glfw3/build
39+
cmake -DBUILD_SHARED_LIBS=OFF -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_DOCS=OFF ..
40+
cmake --build .
41+
sudo make install
42+
popd
43+
;;
44+
esac
2845
- cmake --version || true
2946
- $CC --version || true
3047
- $CXX --version || true
@@ -33,13 +50,33 @@ before_script:
3350
script:
3451
- ./configure -c "$(basename $CXX)" -b DEBUG
3552
- pushd build && make && popd
53+
- ./build/miners --help
54+
- ./build/miners -l
3655
- ./configure -c "$(basename $CXX)" -b RELEASE
37-
- pushd build && make -j && popd
56+
- pushd build && make VERBOSE=1 -j && popd
57+
- ./build/miners -h
58+
- ./build/miners --list
3859
- mv -v build/miners "build/miners-$TRAVIS_OS_NAME-$(basename $CC)-$(git describe --abbrev --dirty --always --tags)"
3960

4061
after_script:
4162
- set +e
4263

64+
after_success:
65+
- |
66+
if [[ "$TRAVIS_SECURE_ENV_VARS" == 'true' ]] && [[ "$TRAVIS_BRANCH" == 'master' ]]; then
67+
MAJOR='v0'
68+
minor="$(($(git describe --tags | cut -d. -f2) + 1))"
69+
tag=$MAJOR-$minor-$TRAVIS_BUILD_NUMBER
70+
git config --global user.email 'pierrefenoll+travis-miners@gmail.com'
71+
git config --global user.name 'Autotag'
72+
git remote set-url origin git@github.com:$TRAVIS_REPO_SLUG.git
73+
git tag -a $tag -m $tag $TRAVIS_COMMIT
74+
chmod 600 travis-miners
75+
eval `ssh-agent -s`
76+
ssh-add travis-miners
77+
git push --tags
78+
fi
79+
4380
deploy:
4481
provider: releases
4582
api_key:

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ find_package(OpenGL REQUIRED)
2424
include_directories(${OpenGL_INCLUDE_DIR})
2525
find_package(GLEW REQUIRED)
2626
include_directories(${GLEW_INCLUDE_DIRS})
27-
find_package(glfw3 3.2 REQUIRED)
28-
include_directories(${GLFW3_INCLUDE_DIRS})
27+
find_package(PkgConfig REQUIRED)
28+
pkg_search_module(GLFW REQUIRED glfw3)
29+
include_directories(${GLFW_INCLUDE_DIRS})
2930

3031
#-----------------------------------------------------------------------------
3132
# BUILD TYPES & FLAGS
@@ -53,7 +54,6 @@ endif()
5354
include_directories(
5455
${PROJECT_SOURCE_DIR}/src/include
5556
${PROJECT_SOURCE_DIR}/src/common
56-
${PROJECT_SOURCE_DIR}/src/common/thirdparty/glfw/include
5757
)
5858

5959
set(SOURCES
@@ -110,9 +110,11 @@ target_link_libraries(miners
110110
m
111111
${OPENGL_gl_LIBRARY}
112112
${GLEW_LIBRARIES}
113-
glfw
113+
${GLFW_STATIC_LIBRARIES} # This needs manual addition of ${GLFW_STATIC_LDFLAGS}
114114
${EXTRA_LIBS}
115115
)
116+
string(REPLACE ";" " " glfw_static_ldflags "${GLFW_STATIC_LDFLAGS}")
117+
set_property(TARGET miners APPEND_STRING PROPERTY LINK_FLAGS "${glfw_static_ldflags}")
116118

117119
add_custom_command(TARGET miners POST_BUILD
118120
COMMAND ln -sf ${PROJECT_SOURCE_DIR}/src/resources .)

src/common/thirdparty/glfw/COPYING.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)