From kde-commits Tue Nov 01 14:05:39 2016 From: Allen Winter Date: Tue, 01 Nov 2016 14:05:39 +0000 To: kde-commits Subject: [clazy] /: CMakeLists.txt - remove CLAZY_MACPORTS option; use if(APPLE) instead Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147800914925682 Git commit d06a981605de9c3c4f7ab6bf2ef4de952ee345bf by Allen Winter. Committed on 01/11/2016 at 14:04. Pushed by winterz into branch 'master'. CMakeLists.txt - remove CLAZY_MACPORTS option; use if(APPLE) instead update README for MacPorts and Homebrew CCBUG: 352896 M +2 -3 CMakeLists.txt M +20 -3 README.md http://commits.kde.org/clazy/d06a981605de9c3c4f7ab6bf2ef4de952ee345bf diff --git a/CMakeLists.txt b/CMakeLists.txt index def9211..9ca83df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,6 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/li= b) add_definitions(-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS) add_definitions(-D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H) = -option(CLAZY_MACPORTS "Enable this option to build against llvm from MacPo= rts" OFF) option(CLAZY_INSTALL_NO_HEADERS "Enable this option to suppress installati= on of headers" OFF) option(CLAZY_ON_WINDOWS_HACK "Enable this option if you're using a patched= clang to support plugins on Windows" OFF) if(CLAZY_ON_WINDOWS_HACK) @@ -87,7 +86,7 @@ macro(add_clang_plugin name) target_link_libraries(${name} version.lib) endif() = - if(CLAZY_MACPORTS) + if(APPLE) target_link_libraries(${name} LLVM) endif() = @@ -122,7 +121,7 @@ link_directories("${LLVM_INSTALL_PREFIX}/lib" ${LLVM_LI= BRARY_DIRS}) add_library(clazylib SHARED ${CLAZY_LIB_SRC}) link_to_llvm(clazylib) = -if(CLAZY_MACPORTS) +if(APPLE) target_link_libraries(clazylib LLVM) endif() = diff --git a/README.md b/README.md index 6b07c2b..11ff17c 100644 --- a/README.md +++ b/README.md @@ -63,10 +63,11 @@ jom, nmake, git, cmake and cl should be in your PATH. > cmake -DCMAKE_INSTALL_PREFIX=3Dc:\my_install_folder\llvm\ -DCMAKE_BUIL= D_TYPE=3DRelease -G "NMake Makefiles JOM" -DCLAZY_ON_WINDOWS_HACK=3DON > jom && nmake install ``` + --------------------------------------------------------------------------= ------ -# Build Instructions (macOS) +# Build Instructions (macOS with MacPorts) = -#### Install clang and llvm from macports +#### Install clang and llvm from MacPorts = ``` $ sudo port install clang-3.8 llvm-3.8 @@ -76,7 +77,23 @@ $ sudo port select --set clang mp-clang-3.8 #### Build the clazy plugin ``` $ export CXX=3Dclang++ - $ cmake -DCLAZY_MACPORTS=3DON + $ cmake + $ make + $ make install +``` + +--------------------------------------------------------------------------= ------ +# Build Instructions (macOS with Homebrew) + +#### Install clang and llvm from Homebrew + +``` +$ brew install --with-clang llvm + +#### Build the clazy plugin +``` + $ export LLVM_ROOT=3D/usr/local/opt/llvm + $ cmake $ make $ make install ```