Skip to content

Commit

Permalink
CI/CD - switch macOS build to CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
gkv311 committed Jan 3, 2025
1 parent 1662cab commit 8eed748
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_macos_13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
brew update
brew install \
freetype \
ffmpeg
ffmpeg \
openal-soft
- name: Compile
run: |
./adm/ci/build_sview_osx.sh
30 changes: 26 additions & 4 deletions adm/ci/build_sview_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,36 @@
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";

aSrcRoot=$aScriptPath/../..
aBuildPath=$aSrcRoot/build

# define number of jobs from available CPU cores
aNbJobs="$(getconf _NPROCESSORS_ONLN)"

aSrcRoot=$aScriptPath/../..

# avoid implicit Android target build when NDK is installed system-wide
unset ANDROID_NDK

# perform building itself
make --directory=$aSrcRoot clean
make --directory=$aSrcRoot -j $aNbJobs WERROR_LEVEL=1
#make --directory=$aSrcRoot clean
#make --directory=$aSrcRoot -j $aNbJobs WERROR_LEVEL=1

# libraries are expected to be found at /usr/local/
aBrewPrefix="$(brew --prefix)"
FREETYPE_DIR=$aBrewPrefix
FFMPEG_DIR=$aBrewPrefix
OPENAL_DIR=$aBrewPrefix/opt/openal-soft

#export CXXFLAGS=-Wno-error=cpp -Wno-error=deprecated-declarations
cmake -G "Unix Makefiles" \
-D BUILD_TREAT_WARNINGS_AS_ERRORS=ON \
-D CMAKE_INSTALL_PREFIX="$aBuildPath/install" \
-D FREETYPE_DIR="$FREETYPE_DIR" \
-D FFMPEG_DIR="$FFMPEG_DIR" \
-D OPENAL_DIR="$OPENAL_DIR" \
-D USE_OPENVR=OFF \
-S "$aSrcRoot" -B "$aBuildPath"

cmake --build "$aBuildPath" --config Release --target clean
cmake --build "$aBuildPath" --config Release

#cmake --build "$aBuildPath" --config Release --target install
3 changes: 3 additions & 0 deletions adm/cmake/FindFreetype.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ set (FREETYPE_IMPLIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
set (FREETYPE_SHAREDLIB_FOUND)
if (EXISTS "${FREETYPE_INCLUDE_DIR}/ft2build.h")
set (FREETYPE_INCLUDE_DIR_FOUND ON)
elseif (EXISTS "${FREETYPE_INCLUDE_DIR}/freetype2/ft2build.h")
set (FREETYPE_INCLUDE_DIR_FOUND ON)
set (FREETYPE_INCLUDE_DIR "${FREETYPE_INCLUDE_DIR}/freetype2")
endif()

if (EXISTS "${FREETYPE_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}freetype${CMAKE_STATIC_LIBRARY_SUFFIX}")
Expand Down

0 comments on commit 8eed748

Please sign in to comment.