mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 18:43:02 +01:00
[build] [cmake] Add ICU setup section. Add clang ifdef.
This commit is contained in:
parent
e231da4666
commit
27fea40d94
@ -4,10 +4,11 @@
|
||||
# This file has following organization:
|
||||
# 1. cmake settings
|
||||
# 2. project settings
|
||||
# 3. configure
|
||||
# 4. compiler & linker settings
|
||||
# 5. pre-build
|
||||
# 6. build
|
||||
# 3. packages
|
||||
# 4. configure
|
||||
# 5. compiler & linker settings
|
||||
# 6. pre-build
|
||||
# 7. build
|
||||
#
|
||||
|
||||
################################################################################
|
||||
@ -102,6 +103,41 @@ elseif (UNIX)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${output_dir}/bin)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# packages
|
||||
#
|
||||
################################################################################
|
||||
|
||||
########################################
|
||||
# icu
|
||||
########################################
|
||||
|
||||
if (UNIX)
|
||||
if (NOT ICU_INCLUDE_DIR)
|
||||
find_path(ICU_INCLUDE_DIR unicode/ucnv.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/include/x86_64-linux-gnu
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
)
|
||||
if ("${ICU_INCLUDE_DIR}" STREQUAL "ICU_INCLUDE_DIR-NOTFOUND")
|
||||
message(FATAL_ERROR "ICU headers not found!")
|
||||
endif()
|
||||
endif()
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${ICU_INCLUDE_DIR}/unicode
|
||||
${CMAKE_BINARY_DIR}/unicode
|
||||
)
|
||||
set(ICU_INCLUDE_DIR ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
|
||||
include_directories(${ICU_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# configure
|
||||
@ -160,24 +196,6 @@ if (MINGW)
|
||||
endif()
|
||||
|
||||
if (UNIX)
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
find_path(ICU_INCLUDE_DIR unicode/ucnv.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/include/x86_64-linux-gnu
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
)
|
||||
if (ICU_INCLUDE_DIR)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${ICU_INCLUDE_DIR}/unicode
|
||||
${CMAKE_BINARY_DIR}/unicode
|
||||
)
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(OS_DIR posix)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(MVS) || defined (DARWIN)
|
||||
#if defined(MVS) || defined(DARWIN) || defined(__clang__)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
|
Loading…
Reference in New Issue
Block a user