Skip to content

Commit 38e3136

Browse files
committed
cmake: Take updates from cdk.
1 parent 19fafe1 commit 38e3136

File tree

5 files changed

+22
-105
lines changed

5 files changed

+22
-105
lines changed

cmake/compiler/CLANG.cmake

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
#
2-
# If Clang is used and deployment target is not specified
3-
# with MACOSX_DEPLOYMENT_TARGET environment variable, make
4-
# sure that clang's native implementation of C++ std
5-
# libarary (libc++) is used. Otherwise clang defaults to
6-
# GNU version (libstdc++) which is outdated and does
7-
# not handle C++11 well.
8-
#
9-
# TODO: Add option to use the default runtime if user wishes
10-
# so.
11-
#
121

13-
function(set_visibility)
14-
add_compile_options(-fvisibility-ms-compat)
15-
endfunction()
2+
function(enable_cxx11)
163

17-
# ???
4+
#
5+
# If Clang is used and deployment target is not specified
6+
# with MACOSX_DEPLOYMENT_TARGET environment variable, make
7+
# sure that clang's native implementation of C++ std
8+
# libarary (libc++) is used. Otherwise clang defaults to
9+
# GNU version (libstdc++) which is outdated and does
10+
# not handle C++11 well.
11+
#
12+
# TODO: Add option to use the default runtime if user wishes
13+
# so.
14+
#
1815

19-
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang"
20-
AND NOT DEFINED ENV{MACOSX_DEPLOYMENT_TARGET}
21-
AND NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
16+
add_flags(CXX -std=c++11 -stdlib=libc++)
17+
18+
endfunction()
2219

23-
list(APPEND CPP11FLAGS -stdlib=libc++)
2420

25-
endif()
21+
function(set_visibility)
22+
add_compile_options(-fvisibility-ms-compat)
23+
endfunction()
24+

cmake/compiler/SUNPRO.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ endfunction()
3939

4040

4141
function(enable_pic)
42-
add_compile_options(CXX -KPIC)
42+
add_flags(CXX -KPIC)
4343
endfunction()
4444

4545

cmake/libutils.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ function(merge_libraries TARGET)
150150
# Note: empty.c is not really needed, but cmake does not accept a library
151151
# target with no sources.
152152

153-
set_property(SOURCE "${LIBUTILS_SCRIPT_DIR}/empty.c" PROPERTY LANGUAGE CXX)
153+
set_property(SOURCE "${LIBUTILS_SCRIPT_DIR}/empty.cc" PROPERTY LANGUAGE CXX)
154154

155-
add_library(${TARGET} ${TYPE} "${LIBUTILS_SCRIPT_DIR}/empty.c")
155+
add_library(${TARGET} ${TYPE} "${LIBUTILS_SCRIPT_DIR}/empty.cc")
156156
target_link_libraries(${TARGET} PRIVATE ${ARGN})
157157

158158
#
File renamed without changes.

cmake/libutils/save_linker_opts.cmake

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)