mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 17:39:46 +00:00
simplify macOS build
This commit is contained in:
parent
348c058c9b
commit
698fd32071
4 changed files with 38 additions and 14 deletions
13
Brewfile
Normal file
13
Brewfile
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
brew "cmake"
|
||||
brew "ninja"
|
||||
brew "pkgconf"
|
||||
brew "glfw"
|
||||
brew "glew"
|
||||
brew "glm"
|
||||
brew "libpng"
|
||||
brew "libvorbis"
|
||||
brew "luajit"
|
||||
brew "openal-soft"
|
||||
brew "freetype"
|
||||
brew "openssl@3"
|
||||
brew "googletest"
|
||||
|
|
@ -72,8 +72,8 @@
|
|||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"VOXELENGINE_BUILD_TESTS": "ON",
|
||||
"VOXELENGINE_BUILD_APPDIR": "ON"
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"VOXELENGINE_BUILD_TESTS": "ON"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
@ -105,8 +105,7 @@
|
|||
},
|
||||
{
|
||||
"name": "default-ninja-clang-macos",
|
||||
"configurePreset": "default-ninja-clang-macos",
|
||||
"configuration": "Debug"
|
||||
"configurePreset": "default-ninja-clang-macos"
|
||||
}
|
||||
],
|
||||
"testPresets": [
|
||||
|
|
|
|||
15
README.md
15
README.md
|
|
@ -65,21 +65,16 @@ cmake --build . --parallel
|
|||
### Install libraries
|
||||
|
||||
```sh
|
||||
brew install glfw glew glm libpng libvorbis lua luajit libcurl openal-soft freetype
|
||||
git clone --recursive https://github.com/MihailRis/VoxelCore.git
|
||||
cd VoxelCore
|
||||
brew bundle
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
> If Homebrew fails to install `lua`, `luajit`, or `openal-soft`, download, compile, and install them manually.
|
||||
|
||||
### Building engine with CMake
|
||||
|
||||
```sh
|
||||
git clone --recursive https://github.com/MihailRis/VoxelCore.git
|
||||
cd VoxelCore
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . --parallel
|
||||
cmake --preset default-ninja-clang-macos
|
||||
cmake --build --preset default-ninja-clang-macos
|
||||
```
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -13,6 +13,17 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|||
# specific for vcpkg
|
||||
find_package(OpenAL CONFIG REQUIRED)
|
||||
else()
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT OPENAL_INCLUDE_DIR)
|
||||
execute_process(
|
||||
COMMAND brew --prefix openal-soft
|
||||
OUTPUT_VARIABLE OPENAL_SOFT_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
|
||||
if(EXISTS "${OPENAL_SOFT_DIR}/include/AL/alext.h")
|
||||
set(OPENAL_INCLUDE_DIR "${OPENAL_SOFT_DIR}/include" CACHE PATH "")
|
||||
set(OPENAL_LIBRARY "${OPENAL_SOFT_DIR}/lib/libopenal.dylib"
|
||||
CACHE FILEPATH "")
|
||||
endif()
|
||||
endif()
|
||||
find_package(OpenAL REQUIRED)
|
||||
if(NOT TARGET OpenAL::OpenAL)
|
||||
add_library(OpenAL::OpenAL UNKNOWN IMPORTED)
|
||||
|
|
@ -25,6 +36,12 @@ endif()
|
|||
find_package(ZLIB REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
find_package(CURL REQUIRED)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT OPENSSL_ROOT_DIR)
|
||||
execute_process(
|
||||
COMMAND brew --prefix openssl@3
|
||||
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
|
||||
endif()
|
||||
find_package(OpenSSL 3.0 REQUIRED COMPONENTS Crypto)
|
||||
find_package(glfw3 REQUIRED)
|
||||
find_package(Freetype REQUIRED)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue