Fix build on OSX, update README.md

This commit is contained in:
Jacob Dufault 2017-04-18 10:21:53 -07:00
parent 2462d5a1ba
commit 121336c976
2 changed files with 10 additions and 4 deletions

View File

@ -32,10 +32,11 @@ in the `vscode-client` folder.
# Build cquery # Build cquery
$ git clone https://github.com/jacobdufault/cquery --recursive $ git clone https://github.com/jacobdufault/cquery --recursive
$ cd cquery $ cd cquery
$ pushd third_party/sparsehash # This step will eventually be eliminated # Note: In the future we should not have to build sparsehash explicitly.
$ ./configure # This step will eventually be eliminated $ pushd third_party/sparsehash
# sparsehash is header-only; building it is not required $ ./configure
$ popd # This step will eventually be eliminated $ make
$ popd
$ ./waf configure $ ./waf configure
$ ./waf build $ ./waf build

View File

@ -19,6 +19,7 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <dirent.h>
#include <sys/types.h> // required for stat.h #include <sys/types.h> // required for stat.h
#include <sys/stat.h> // no clue why required -- man pages say so #include <sys/stat.h> // no clue why required -- man pages say so
@ -29,7 +30,9 @@
#include <sys/stat.h> /* For mode constants */ #include <sys/stat.h> /* For mode constants */
#include <fcntl.h> /* For O_* constants */ #include <fcntl.h> /* For O_* constants */
#ifndef __APPLE__
#include <sys/prctl.h> #include <sys/prctl.h>
#endif
struct PlatformMutexLinux : public PlatformMutex { struct PlatformMutexLinux : public PlatformMutex {
sem_t* sem_ = nullptr; sem_t* sem_ = nullptr;
@ -155,7 +158,9 @@ bool TryMakeDirectory(const std::string& absolute_path) {
} }
void SetCurrentThreadName(const std::string& thread_name) { void SetCurrentThreadName(const std::string& thread_name) {
#ifndef __APPLE__
prctl(PR_SET_NAME, thread_name.c_str(), 0, 0, 0); prctl(PR_SET_NAME, thread_name.c_str(), 0, 0, 0);
#endif
} }
std::vector<std::string> GetPlatformClangArguments() { std::vector<std::string> GetPlatformClangArguments() {