Use Nettle for macOS build, tweaks (#3749)

This commit is contained in:
QwertyChouskie 2019-02-09 15:52:09 -08:00 committed by auriamg
parent 8ebb0b2e9a
commit 1872ef86b4
3 changed files with 11 additions and 23 deletions

View File

@ -1,8 +1,9 @@
brew "cmake"
brew "libogg"
brew "libvorbis"
brew "openal-soft"
brew "freetype"
brew "curl"
brew "openssl@1.1"
brew "nettle"
brew "fribidi"
brew "glew"

View File

@ -24,8 +24,7 @@ option(USE_SYSTEM_ANGELSCRIPT "Use system angelscript instead of built-in angels
option(USE_SYSTEM_ENET "Use system ENET instead of the built-in version, when available." ON)
option(USE_SYSTEM_GLEW "Use system GLEW instead of the built-in version, when available." ON)
CMAKE_DEPENDENT_OPTION(USE_CRYPTO_OPENSSL "Use OpenSSL instead of Nettle for cryptography in STK." OFF
"NOT APPLE" ON)
option(USE_CRYPTO_OPENSSL "Use OpenSSL instead of Nettle for cryptography in STK." OFF)
CMAKE_DEPENDENT_OPTION(BUILD_RECORDER "Build opengl recorder" ON
"NOT SERVER_ONLY;NOT APPLE" OFF)
CMAKE_DEPENDENT_OPTION(USE_FRIBIDI "Support for right-to-left languages" ON

View File

@ -187,35 +187,21 @@ sudo ln -s `xcrun --show-sdk-path`/System/Library/Frameworks/OpenGL.framework/He
```
The first link is required in order to find libcurl, the second to find opengl.
### CMake
### STK 0.10 or later (or latest git)
CMake is used to build STK. At this time CMake will not make a binary that is ready for distribution.
You'll have to run these commands inside your stk-code directory.
### STK 0.9.4 or later (or latest git)
Install homebrew ( https://brew.sh/)
Install all of the dependencies using homebrew :
Install homebrew (https://brew.sh/)
Install all of the dependencies using homebrew:
```bash
brew install libogg
brew install libvorbis
brew install openal-soft
brew install freetype
brew install curl
brew install nettle
brew install openssl@1.1
brew install fribidi
brew install glew
cd /path/to/stk-code
brew bundle
```
Build STK
```bash
mkdir cmake_build
cd cmake_build
CMAKE_PREFIX_PATH=/usr/local/opt/freetype/:/usr/local/opt/curl/:/usr/local/opt/libogg/:/usr/local/opt/libogg/:/usr/local/opt/libvorbis/:/usr/local/opt/openssl\@1.1/:/usr/local/opt/glew/:/usr/local/opt/fribidi/ /usr/local/opt/cmake/bin/cmake .. -DFREETYPE_INCLUDE_DIRS=/usr/local/opt/freetype/include/freetype2/ -DUSE_SYSTEM_GLEW=1 -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include/ -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DFREETYPE_LIBRARY=/usr/local/opt/freetype/lib/libfreetype.dylib
CMAKE_PREFIX_PATH=/usr/local/opt/freetype/:/usr/local/opt/curl/:/usr/local/opt/libogg/:/usr/local/opt/libogg/:/usr/local/opt/libvorbis/:/usr/local/opt/glew/:/usr/local/opt/fribidi/ cmake .. -DFREETYPE_INCLUDE_DIRS=/usr/local/opt/freetype/include/freetype2/ -DUSE_SYSTEM_GLEW=1 -DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include/ -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib -DFREETYPE_LIBRARY=/usr/local/opt/freetype/lib/libfreetype.dylib
make
```
@ -236,6 +222,7 @@ Download pre-built dependencies from [here](https://sourceforge.net/projects/sup
Building with clang:
```bash
cd /path/to/stk-code
mkdir cmake_build
cd cmake_build
cmake ..
@ -244,6 +231,7 @@ make
Building with GCC:
```bash
cd /path/to/stk-code
mkdir cmake_build
cd cmake_build
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_C_COMPILER=/usr/bin/gcc