From 1443001a998646cffb47e0c643ee319eadd6f307 Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Fri, 28 Jun 2019 17:09:18 +0100 Subject: [PATCH] added more information on how to catch overloaded virtuals --- .gitignore | 2 ++ CMakeLists.txt | 9 +++++---- dobuild | 2 +- dobuildClang | 4 ++++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100755 dobuildClang diff --git a/.gitignore b/.gitignore index 3225a63..81be867 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +build +compile_commands.json CMakeCache.txt CMakeFiles/* cmake_install.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 135e02f..8a1cec4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ set(CMAKE_BUILD_TYPE Release CACHE STRING "Build configuration (Debug, Release, RelWithDebInfo, MinSizeRel)") project(pdf2htmlEX) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) option(ENABLE_SVG "Enable SVG support, for generating SVG background images and converting Type 3 fonts" ON) @@ -70,12 +71,12 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") # generic flags set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Woverloaded-virtual") # clang compiler need c++11 flag -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -endif() +#if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +#endif() # CYGWIN or GCC 4.5.x bug if(CYGWIN) diff --git a/dobuild b/dobuild index 5b55a1c..97e5ac1 100755 --- a/dobuild +++ b/dobuild @@ -1,4 +1,4 @@ mkdir build cd build cmake .. -make install +make diff --git a/dobuildClang b/dobuildClang new file mode 100755 index 0000000..4a9914a --- /dev/null +++ b/dobuildClang @@ -0,0 +1,4 @@ +mkdir build +cd build +CC=clang CXX=clang++ cmake .. +make