Skip to content

Commit

Permalink
Merge branch 'main' into ReplaceTMap
Browse files Browse the repository at this point in the history
  • Loading branch information
euskov17 committed Jan 24, 2024
2 parents 3b26b7a + a966925 commit 6b4d66b
Show file tree
Hide file tree
Showing 37 changed files with 681 additions and 1,087 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ util/all_thread.cpp
util/all_util.cpp
util/charset/all_charset.cpp

cmake-build-debug
17 changes: 2 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ include(cmake/antlr.cmake)
include(cmake/archive.cmake)
include(cmake/bison.cmake)
include(cmake/common.cmake)
include(cmake/conan.cmake)
include(cmake/fbs.cmake)
include(cmake/global_flags.cmake)
include(cmake/llvm-tools.cmake)
Expand All @@ -30,20 +29,8 @@ include(cmake/protobuf.cmake)
include(cmake/shared_libs.cmake)
include(cmake/global_vars.cmake)

if (CMAKE_CROSSCOMPILING)
include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
else()
conan_cmake_autodetect(settings)
conan_cmake_install(
PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR}
INSTALL_FOLDER ${CMAKE_BINARY_DIR}
BUILD missing
REMOTE conancenter
SETTINGS ${settings}
ENV "CONAN_CMAKE_GENERATOR=${CMAKE_GENERATOR}"
CONF "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}"
)
endif()
find_package(IDN REQUIRED)
find_package(Iconv REQUIRED)

add_subdirectory(tools)
add_subdirectory(contrib)
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@

## Prerequisites

- cmake 3.22+
- clang-14
- lld-14
- git 2.20+
- ninja 1.10+
- cmake 3.22+
- clang-14
- lld-14
- git 2.20+
- ninja 1.10+
- ragel
- yasm

## Runtime Requirements

- libidn11-dev
- libiconv

## Install dependencies

```bash
sudo apt-get -y install git cmake ninja-build clang-14 lld-14 libidn11-dev llvm-14
sudo apt-get -y install git cmake ninja-build clang-14 lld-14 libidn11-dev llvm-14 ragel yasm
```

- libiconv: https://www.gnu.org/software/libiconv/

## Create the work directory

```bash
Expand Down
26 changes: 26 additions & 0 deletions cmake/FindIconv.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# - Find Iconv
#
# Iconv_INCLUDE - Where to find LibIconv public headers
# Iconv_LIBS - List of libraries when using LibIconv.
# Iconv_FOUND - True if LibIconv found.

find_path(Iconv_INCLUDE_DIR
iconv.h
HINTS $ENV{Iconv_ROOT}/include)

find_library(Iconv_LIBRARIES
iconv
HINTS $ENV{Iconv_ROOT}/lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Iconv DEFAULT_MSG Iconv_LIBRARIES Iconv_INCLUDE_DIR)

mark_as_advanced(Iconv_INCLUDE_DIR Iconv_LIBRARIES)

if (Iconv_FOUND AND NOT TARGET Iconv::Iconv)
add_library(Iconv::Iconv UNKNOWN IMPORTED)
set_target_properties(Iconv::Iconv PROPERTIES
IMPORTED_LOCATION ${Iconv_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${Iconv_INCLUDE_DIR}
)
endif()
4 changes: 2 additions & 2 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ endfunction()


function(target_ragel_lexers TgtName Key Src)
SET(RAGEL_BIN ${CMAKE_BINARY_DIR}/bin/ragel${CMAKE_EXECUTABLE_SUFFIX})
SET(RAGEL_BIN ragel${CMAKE_EXECUTABLE_SUFFIX})
get_filename_component(OutPath ${Src} NAME_WLE)
get_filename_component(SrcDirPath ${Src} DIRECTORY)
get_filename_component(OutputExt ${OutPath} EXT)
Expand All @@ -38,7 +38,7 @@ function(target_ragel_lexers TgtName Key Src)
endfunction()

function(target_yasm_source TgtName Key Src)
SET(YASM_BIN ${CMAKE_BINARY_DIR}/bin/yasm${CMAKE_EXECUTABLE_SUFFIX})
SET(YASM_BIN yasm${CMAKE_EXECUTABLE_SUFFIX})
get_filename_component(OutPath ${Src} NAME_WLE)
string(APPEND OutPath .o)
add_custom_command(
Expand Down
28 changes: 0 additions & 28 deletions cmake/conan-profiles/linux.aarch64.profile

This file was deleted.

11 changes: 0 additions & 11 deletions cmake/conan-profiles/macos.arm64.profile

This file was deleted.

Loading

0 comments on commit 6b4d66b

Please sign in to comment.