summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-10 19:47:54 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-10 19:47:54 +0000
commit626916fc255c40bc45e0f20ee69faf48f5094cac (patch)
treeb57b5e35938e3bb5bf4c80181a6c1c3109389c9a /lib
parentb8f787b18830ae120fc195f47735a02e84d1a344 (diff)
downloadexternal_libcxx-626916fc255c40bc45e0f20ee69faf48f5094cac.tar.gz
external_libcxx-626916fc255c40bc45e0f20ee69faf48f5094cac.tar.bz2
external_libcxx-626916fc255c40bc45e0f20ee69faf48f5094cac.zip
Add CMake build and fix major Linux blockers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@121510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CMakeLists.txt56
-rwxr-xr-xlib/buildit4
2 files changed, 58 insertions, 2 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100644
index 000000000..d8617842b
--- /dev/null
+++ b/lib/CMakeLists.txt
@@ -0,0 +1,56 @@
+# Get sources
+file(GLOB_RECURSE sources ../src/*.cpp)
+
+# Add all the headers to the project for IDEs.
+if (MSVC_IDE OR XCODE)
+ file(GLOB_RECURSE headers ../include/*)
+ # Force them all into the headers dir on MSVC, otherwise they end up at
+ # project scope because they don't have extensions.
+ if (MSVC_IDE)
+ source_group("Header Files" FILES ${headers})
+ endif()
+endif()
+
+if (LIBCXX_ENABLE_SHARED)
+ add_library(cxx SHARED
+ ${sources}
+ ${headers}
+ )
+else()
+ add_library(cxx STATIC
+ ${sources}
+ ${headers}
+ )
+endif()
+
+# Generate library list.
+append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread)
+append_if(libraries LIBCXX_HAS_C_LIB c)
+append_if(libraries LIBCXX_HAS_M_LIB m)
+append_if(libraries LIBCXX_HAS_GCC_S_LIB gcc_s)
+
+target_link_libraries(cxx ${libraries})
+
+# Setup flags.
+append_if(compile_flags LIBCXX_HAS_FPIC_FLAG -fPIC)
+append_if(link_flags LIBCXX_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)
+
+set_target_properties(cxx
+ PROPERTIES
+ COMPILE_FLAGS "${compile_flags}"
+ LINK_FLAGS "${link_flags}"
+ OUTPUT_NAME "c++"
+ VERSION "1.0"
+ SOVERSION "1"
+ )
+
+install(TARGETS cxx
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ )
+
+install(DIRECTORY ../include/
+ DESTINATION include/c++/v1
+ FILES_MATCHING
+ PATTERN "*"
+ )
diff --git a/lib/buildit b/lib/buildit
index 737595f72..db2294283 100755
--- a/lib/buildit
+++ b/lib/buildit
@@ -2,7 +2,7 @@
#
# Set the $TRIPLE environment variable to your system's triple before
# running this script. If you set $CXX, that will be used to compile
-# the library. Otherwise we'll use g++.
+# the library. Otherwise we'll use clang++.
set -e
@@ -74,7 +74,7 @@ for FILE in ../src/*.cpp; do
done
-cc *.o $RC_CFLAGS $LDSHARED_FLAGS
+cc *.o $RC_CFLAGS $LDSHARED_FLAGS
#libtool -static -o libc++.a *.o