Skip to content

Commit 06e7ca7

Browse files
harshith-212shubhluck
authored andcommitted
Revert "HDFS-14033. [libhdfs++] Disable libhdfs++ build on systems that do not support thread_local. Contributed by Anatoli Shein."
This reverts commit 5a6d88b.
1 parent 947ffce commit 06e7ca7

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

hadoop-hdfs-project/hadoop-hdfs-native-client/src/CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,21 @@ if(WIN32)
5858
# Omit unneeded headers.
5959
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN")
6060
set(OS_DIR ${CMAKE_SOURCE_DIR}/main/native/libhdfs/os/windows)
61-
set(OUT_DIR target/bin)
61+
62+
# IMPORTANT: OUT_DIR MUST be relative to maven's
63+
# project.build.directory (=target) and match dist-copynativelibs
64+
# in order to be in a release
65+
set(OUT_DIR bin)
6266
else()
6367
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
68+
# using old default behavior on GCC >= 10.0
69+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcommon")
6470
set(OS_DIR ${CMAKE_SOURCE_DIR}/main/native/libhdfs/os/posix)
65-
set(OUT_DIR target/usr/local/lib)
71+
72+
# IMPORTANT: OUT_DIR MUST be relative to maven's
73+
# project.build.directory (=target) and match dist-copynativelibs
74+
# in order to be in a release
75+
set(OUT_DIR native/target/usr/local/lib)
6676
endif()
6777

6878
# Configure JNI.
@@ -142,7 +152,8 @@ add_subdirectory(main/native/libhdfs-tests)
142152
# Temporary fix to disable Libhdfs++ build on older systems that do not support thread_local
143153
include(CheckCXXSourceCompiles)
144154
unset (THREAD_LOCAL_SUPPORTED CACHE)
145-
set (CMAKE_REQUIRED_DEFINITIONS "-std=c++11")
155+
set (CMAKE_CXX_STANDARD 11)
156+
set (CMAKE_CXX_STANDARD_REQUIRED ON)
146157
set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
147158
check_cxx_source_compiles(
148159
"#include <thread>

0 commit comments

Comments
 (0)