From 801269cfa703a82fbd788ff93afaac16d114e673 Mon Sep 17 00:00:00 2001 From: Ned Williamson Date: Thu, 14 Oct 2021 21:38:05 -0700 Subject: [PATCH] Let user specify compiler --- CMakeLists.txt | 4 +--- Dockerfile | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f82a24f..2379375 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,6 @@ cmake_minimum_required(VERSION 3.5.1) project(sockfuzzer) -set(CMAKE_C_COMPILER clang) -set(CMAKE_CXX_COMPILER clang++) # TODO(nedwill): We should not depend directly on third_party module paths set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/third_party/libprotobuf-mutator/cmake/external) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -570,7 +568,7 @@ if(NOT DEFINED ENV{SANITIZER} AND NOT APPLE) endif() # TODO(nedwill): get the local protobuf build working to support msan -# include(protobuf) +# add_subdirectory(third_party/libprotobuf-mutator) find_package(Protobuf REQUIRED) include_directories(${PROTOBUF_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Dockerfile b/Dockerfile index 746baa0..ea9ea8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,6 @@ RUN ./configure --disable-shared RUN make -j $(nproc) RUN make install +WORKDIR $SRC # You can now build using cmake. I use a subdirectory "build". COPY build.sh $SRC -WORKDIR /source/build diff --git a/README.md b/README.md index 6279422..4fa093b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ for your platform. For example: ``` $ mkdir build; cd build -$ cmake -GNinja .. +$ CC=clang CXX=clang++ cmake -GNinja .. $ ninja ```