8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 09:20:39 +01:00

[build] [cmake] Add ICU setup section. Add clang ifdef.

This commit is contained in:
egorpugin 2015-02-07 16:07:04 +00:00
parent e231da4666
commit 27fea40d94
2 changed files with 41 additions and 23 deletions

View File

@ -4,10 +4,11 @@
# This file has following organization: # This file has following organization:
# 1. cmake settings # 1. cmake settings
# 2. project settings # 2. project settings
# 3. configure # 3. packages
# 4. compiler & linker settings # 4. configure
# 5. pre-build # 5. compiler & linker settings
# 6. build # 6. pre-build
# 7. build
# #
################################################################################ ################################################################################
@ -102,6 +103,41 @@ elseif (UNIX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${output_dir}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${output_dir}/bin)
endif() 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 # configure
@ -160,24 +196,6 @@ if (MINGW)
endif() endif()
if (UNIX) 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(OS_DIR posix)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

View File

@ -48,7 +48,7 @@
#include <stdio.h> #include <stdio.h>
#if defined(MVS) || defined (DARWIN) #if defined(MVS) || defined(DARWIN) || defined(__clang__)
#include <stdlib.h> #include <stdlib.h>
#else #else
#include <malloc.h> #include <malloc.h>