Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Convert System.Globalization.Native to C #22378

Merged
merged 14 commits into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set(CLR_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(VM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/vm)
set(GENERATED_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/inc)
set(GENERATED_EVENTING_DIR ${CMAKE_CURRENT_BINARY_DIR}/eventing)
set(VERSION_FILE_PATH "${CMAKE_BINARY_DIR}/version.cpp")
set(VERSION_FILE_PATH "${CMAKE_BINARY_DIR}/version.c")
set(PAL_REDEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/dlls/mscordac/palredefines.S)

set(CORECLR_SET_RPATH ON)
Expand Down
6 changes: 3 additions & 3 deletions build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ build_native_projects()
if [ $__SkipConfigure == 0 ]; then
# if msbuild is not supported, then set __SkipGenerateVersion to 1
if [ $__isMSBuildOnNETCoreSupported == 0 ]; then __SkipGenerateVersion=1; fi
# Drop version.cpp file
__versionSourceFile="$intermediatesForBuild/version.cpp"
# Drop version.c file
__versionSourceFile="$intermediatesForBuild/version.c"
if [ $__SkipGenerateVersion == 0 ]; then
pwd
$__ProjectRoot/dotnet.sh msbuild /nologo /verbosity:minimal /clp:Summary \
Expand All @@ -484,7 +484,7 @@ build_native_projects()
/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll\;LogFile=binclash.log \
$__CommonMSBuildArgs $__UnprocessedBuildArgs
else
# Generate the dummy version.cpp, but only if it didn't exist to make sure we don't trigger unnecessary rebuild
# Generate the dummy version.c, but only if it didn't exist to make sure we don't trigger unnecessary rebuild
__versionSourceLine="static char sccsid[] __attribute__((used)) = \"@(#)No version information produced\";"
if [ -e $__versionSourceFile ]; then
read existingVersionSourceLine < $__versionSourceFile
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ build_native()
if [ $__SkipConfigure == 0 ]; then
# if msbuild is not supported, then set __SkipGenerateVersion to 1
if [ $__isMSBuildOnNETCoreSupported == 0 ]; then __SkipGenerateVersion=1; fi
# Drop version.cpp file
__versionSourceFile="$intermediatesForBuild/version.cpp"
# Drop version.c file
__versionSourceFile="$intermediatesForBuild/version.c"
if [ $__SkipGenerateVersion == 0 ]; then
pwd
"$__ProjectRoot/dotnet.sh" msbuild /nologo /verbosity:minimal /clp:Summary \
Expand All @@ -304,7 +304,7 @@ build_native()
"$__ProjectDir/build.proj" /p:GenerateVersionSourceFile=true /t:GenerateVersionSourceFile /p:NativeVersionSourceFile=$__versionSourceFile \
$__CommonMSBuildArgs $__UnprocessedBuildArgs
else
# Generate the dummy version.cpp, but only if it didn't exist to make sure we don't trigger unnecessary rebuild
# Generate the dummy version.c, but only if it didn't exist to make sure we don't trigger unnecessary rebuild
__versionSourceLine="static char sccsid[] __attribute__((used)) = \"@(#)No version information produced\";"
if [ -e $__versionSourceFile ]; then
read existingVersionSourceLine < $__versionSourceFile
Expand Down
28 changes: 15 additions & 13 deletions src/corefx/System.Globalization.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

project(System.Globalization.Native)
project(System.Globalization.Native C)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -8,6 +7,9 @@ add_definitions(-DBIT64=1)

set(ICU_HOMEBREW_INC_PATH "/usr/local/opt/icu4c/include")

# We mark the function which needs exporting with DLLEXPORT
add_compile_options(-fvisibility=hidden)

find_path(UTYPES_H "unicode/utypes.h" PATHS ${ICU_HOMEBREW_INC_PATH})
if(UTYPES_H STREQUAL UTYPES_H-NOTFOUND)
message(FATAL_ERROR "Cannot find utypes.h, try installing libicu-dev (or the appropriate package for your platform)")
Expand Down Expand Up @@ -39,18 +41,19 @@ endif()
include(configure.cmake)

add_compile_options(-fPIC)
add_compile_options(-Wno-incompatible-pointer-types-discards-qualifiers)

set(NATIVEGLOBALIZATION_SOURCES
calendarData.cpp
casing.cpp
collation.cpp
idna.cpp
locale.cpp
localeNumberData.cpp
localeStringData.cpp
normalization.cpp
timeZoneInfo.cpp
icushim.cpp
pal_calendarData.c
pal_casing.c
pal_collation.c
pal_idna.c
pal_locale.c
pal_localeNumberData.c
pal_localeStringData.c
pal_normalization.c
pal_timeZoneInfo.c
pal_icushim.c
)

include_directories(${UTYPES_H})
Expand Down Expand Up @@ -97,4 +100,3 @@ verify_dependencies(
# add the install targets
install_clr(System.Globalization.Native)
install(TARGETS System.Globalization.Native_Static DESTINATION .)

10 changes: 5 additions & 5 deletions src/corefx/System.Globalization.Native/configure.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include(CheckCXXSourceCompiles)
include(CheckCXXSymbolExists)
include(CheckCSourceCompiles)
include(CheckSymbolExists)

set(CMAKE_REQUIRED_INCLUDES ${UTYPES_H} ${ICU_HOMEBREW_INC_PATH})

CHECK_CXX_SOURCE_COMPILES("
CHECK_C_SOURCE_COMPILES("
#include <unicode/udat.h>
int main() { UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; }
int main(void) { enum UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; }
" HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)

if(NOT CLR_CMAKE_PLATFORM_DARWIN)
Expand All @@ -14,7 +14,7 @@ else()
set(CMAKE_REQUIRED_LIBRARIES ${ICUCORE})
endif()

check_cxx_symbol_exists(
check_symbol_exists(
ucol_setMaxVariable
"unicode/ucol.h"
HAVE_SET_MAX_VARIABLE)
Expand Down
94 changes: 0 additions & 94 deletions src/corefx/System.Globalization.Native/holders.h

This file was deleted.

Loading