Skip to content

Commit aa01888

Browse files
committed
MacOS building shenanigans
1 parent bb3bf84 commit aa01888

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ target_compile_features(project-properties
2626

2727
# Platform properties interface library
2828
add_library(platform-properties INTERFACE)
29+
2930
if (${MSVC})
3031
target_compile_definitions(platform-properties INTERFACE
3132
_WIN32_WINNT=_WIN32_WINNT_WIN10
@@ -35,9 +36,14 @@ if (${MSVC})
3536
elseif(MINGW)
3637
target_link_libraries(platform-properties INTERFACE
3738
icuuc icuio icuin ws2_32 mswsock)
39+
elseif(APPLE)
40+
set(ICU_DEBUG on)
41+
find_package(ICU COMPONENTS uc i18n REQUIRED)
42+
target_link_libraries(platform-properties INTERFACE
43+
ICU::uc ICU::i18n)
3844
else()
3945
target_link_libraries(platform-properties INTERFACE
40-
icuuc icui18n stdc++exp)
46+
icuuc icui18n)
4147
endif()
4248

4349
if (${MSVC})
@@ -48,6 +54,11 @@ else()
4854
-Wall -Wextra -Wpedantic -Wdeprecated-declarations)
4955
endif()
5056

57+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
58+
target_compile_definitions(project-properties INTERFACE _GLIBCXX_HAVE_STACKTRACE)
59+
target_link_libraries(project-properties INTERFACE stdc++exp)
60+
endif()
61+
5162
# alicia-libserver target
5263
add_library(alicia-libserver STATIC
5364
src/libserver/data/DataDirector.cpp

COMPILING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ You can download PostgreSQL binaries as an archive and extract them to a folder
1313

1414
You'll also need to add the `/bin` folder to the `PATH` environment variable so that the `libpq.dll` can be found on runtime.
1515

16+
### On MacOS
17+
18+
Since we're using C++23 features that aren't available in Clang, you'll need to install GCC.
19+
The ICU library, while available on default in other platforms, has to be installed separately on MacOS.
20+
You'll need to ensure you're running CMake with the correct compiler and that CMake can find the ICU library.
21+
22+
```bash
23+
brew install gcc
24+
brew install icu4c
25+
export CC=gcc-15 CXX=g++-15
26+
export ICU_ROOT="/opt/homebrew/opt/icu4c"
27+
export LD_FLAGS="-L/opt/homebrew/opt/icu4c/lib"
28+
```
29+
1630
## Building
1731

1832
1. Clone the repository

0 commit comments

Comments
 (0)