diff options
author | Allen Winter <allen.winter@kdab.com> | 2015-02-15 11:10:10 -0500 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2015-02-15 11:10:10 -0500 |
commit | 1046267802a978702555cedddc8cb817b0d4eed2 (patch) | |
tree | 0c94c80f2e0d8ff52e3420a196d33191c796bb7d | |
parent | 6da7ae903c43af1df72f0806a4b4bacb6917b071 (diff) | |
download | libical-git-1046267802a978702555cedddc8cb817b0d4eed2.tar.gz |
document how to build with Clang and cleanup some Clang warnings
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | Install.txt | 5 | ||||
-rw-r--r-- | examples/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/libical/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/libicalss/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/libicalvcal/CMakeLists.txt | 4 |
6 files changed, 18 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index eda1c1a6..11efbe20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat -Wformat-security") endif() endif() +if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments") +endif() if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") include(CheckCXXCompilerFlag) @@ -263,6 +266,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") endif() endif() +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments") +endif() + option(WITH_CXX_BINDINGS "Build the C++ bindings." True) if(WITH_CXX_BINDINGS) add_definitions(-DWITH_CXX_BINDINGS) diff --git a/Install.txt b/Install.txt index b78afcaa..f18728e8 100644 --- a/Install.txt +++ b/Install.txt @@ -62,6 +62,11 @@ of the libraries, but that behavior can be modified at CMake time: - To build the static libraries only, pass -DSTATIC_ONLY=True to CMake. - To build the shared libraries only, pass -DSHARED_ONLY=True to CMake. +== Building with Different Compilers == +For example, say you want to use Clang to build on Linux. +Then you can set the C and C++ compilers at CMake time, like so: +% CC=clang CXX=clang++ cmake .. + == Optional Dependencies == * Berkeley DB storage. If want to use (try) the Berkeley Database storage you can pass the -DWITH_BDB=True option to CMake. You'll need to have diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 5a05e5d5..9760dbec 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,11 +1,5 @@ -include_directories( - ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src - ${CMAKE_SOURCE_DIR}/src/libical ${CMAKE_BINARY_DIR}/src/libical - ${CMAKE_SOURCE_DIR}/src/libicalss ${CMAKE_BINARY_DIR}/src/libicalss -) -########### next target ############### +########### doesnothing target ############### set(doesnothing_SRCS access_components.c @@ -37,5 +31,3 @@ else() endif() endif() -########### install files ############### - diff --git a/src/libical/CMakeLists.txt b/src/libical/CMakeLists.txt index ab695882..27828522 100644 --- a/src/libical/CMakeLists.txt +++ b/src/libical/CMakeLists.txt @@ -6,10 +6,8 @@ configure_file( include_directories( ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}/src - ${CMAKE_SOURCE_DIR}/src - ${CMAKE_SOURCE_DIR}/src/libical - ${CMAKE_BINARY_DIR}/src/libical + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} ) if(ICU_FOUND) diff --git a/src/libicalss/CMakeLists.txt b/src/libicalss/CMakeLists.txt index 8877a265..7df8f702 100644 --- a/src/libicalss/CMakeLists.txt +++ b/src/libicalss/CMakeLists.txt @@ -1,8 +1,8 @@ include_directories( ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src - ${CMAKE_SOURCE_DIR}/src/libicalss ${CMAKE_BINARY_DIR}/src/libicalss - ${CMAKE_SOURCE_DIR}/src/libical ${CMAKE_BINARY_DIR}/src/libical + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/libical + ${CMAKE_BINARY_DIR}/src/libical ) if(WITH_BDB) include_directories(${BDB_INCLUDE_DIR}) diff --git a/src/libicalvcal/CMakeLists.txt b/src/libicalvcal/CMakeLists.txt index 4ab0c941..b88d2d57 100644 --- a/src/libicalvcal/CMakeLists.txt +++ b/src/libicalvcal/CMakeLists.txt @@ -1,9 +1,5 @@ include_directories( ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src - ${CMAKE_SOURCE_DIR}/src/libicalss ${CMAKE_BINARY_DIR}/src/libicalss - ${CMAKE_SOURCE_DIR}/src/libical ${CMAKE_BINARY_DIR}/src/libical - ${CMAKE_SOURCE_DIR}/src/libicalvcal ${CMAKE_BINARY_DIR}/src/libicalvcal ) #these are generated sources, but we keep them in the repo |