Skip to content

Commit

Permalink
Merge pull request #23 from ydb-platform/fix-macos-build
Browse files Browse the repository at this point in the history
Fixed mac os build and switched clang version
  • Loading branch information
Gazizonoki authored Jan 24, 2024
2 parents a8f5064 + 58c94cf commit bf69aa4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ __pycache__/

# MacOS specific
.DS_Store
*.dSYM

# clangd cache
/.cache
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
## Prerequisites

- cmake 3.22+
- clang-14
- lld-14
- llvm 16+
- git 2.20+
- ninja 1.10+
- ragel
Expand All @@ -18,7 +17,10 @@
## Install dependencies

```bash
sudo apt-get -y install git cmake ninja-build clang-14 lld-14 libidn11-dev llvm-14 ragel yasm
sudo apt-get -y install git cmake ninja-build libidn11-dev ragel yasm
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 16
```

- libiconv: https://www.gnu.org/software/libiconv/
Expand Down
8 changes: 4 additions & 4 deletions clang.toolchain
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(CMAKE_C_COMPILER clang-14)
set(CMAKE_CXX_COMPILER clang++-14)
set(CMAKE_C_COMPILER clang-16)
set(CMAKE_CXX_COMPILER clang++-16)
set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld -rdynamic")
set(CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld")
set(CMAKE_C_STANDARD_LIBRARIES "-lc -lm")
Expand All @@ -12,5 +12,5 @@ endif()
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -UNDEBUG" CACHE STRING "C++ compiler flags")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -UNDEBUG" CACHE STRING "C compiler flags")

set(ENV{CC} clang-14)
set(ENV{CXX} clang++-14)
set(ENV{CC} clang-16)
set(ENV{CXX} clang++-16)
8 changes: 5 additions & 3 deletions ydb/public/lib/yson_value/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ target_link_libraries(public-lib-yson_value PUBLIC
cpp-client-ydb_value
ydb-library-uuid
)
target_link_libraries(public-lib-yson_value PUBLIC
contrib-libs-linux-headers
)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT HAVE_CUDA)
target_link_libraries(public-lib-json_value PUBLIC
contrib-libs-linux-headers
)
endif()

target_sources(public-lib-yson_value PRIVATE
${CMAKE_SOURCE_DIR}/ydb/public/lib/yson_value/ydb_yson_value.cpp
Expand Down

0 comments on commit bf69aa4

Please sign in to comment.