Skip to content
Permalink
Browse files

use generator unspecific clean cmd in build_tools.sh

always generate compile_commands.json
force color diagnostic (to work with ninja)
  • Loading branch information...
turleypol committed Apr 14, 2019
1 parent b2a52d9 commit c0c156123662180643586af1ea35edc1ec715cb0
Showing with 16 additions and 8 deletions.
  1. +8 −7 bin-build/build_tools.sh
  2. +8 −1 cmake/init.cmake
@@ -1,12 +1,12 @@
#!/bin/sh

prune () {
make clean
cmake --build . --target clean
rm -r -f pol-core
rm -r -f lib
rm -r -f docs
rm -r -f CMakeFiles
rm -r -f Testing
rm -r -f Testing
rm -f CMakeCache.txt
rm -f Makefile
rm -f install_manifest.txt
@@ -15,9 +15,10 @@ prune () {
rm -f pol_revision.h
rm -f pol_revision.h.tmp
rm -f cmake_install.cmake
rm -f build.ninja
rm -f rules.ninja
rm -f CTest*
rm -f build.ninja
rm -f rules.ninja
rm -f CTest*
rm -f .ninja_*
}

case "$1" in
@@ -26,14 +27,14 @@ case "$1" in
echo "FORCING GCC"
prune
cmake -GNinja -DUSE_CCACHE=1 -DNO_PCH=1 ..
ninja
ninja
;;
-c|-clang37)
export CXX="clang++" CC="clang";
echo "FORCING CLANG"
prune
cmake -GNinja -DUSE_CCACHE=1 -DNO_PCH=1 ..
ninja
ninja
;;
-p|-prune)
if [ ${PWD##*/} = "bin-build" ]; then
@@ -103,7 +103,8 @@ endmacro()

macro(prepare_build)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(SOURCE_GROUP_DELIMITER "/")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # a few external tools need it
set(SOURCE_GROUP_DELIMITER "/")

if(windows)
set(HAVE_OPENSSL true)
@@ -119,6 +120,12 @@ macro(prepare_build)
${CMAKE_CURRENT_LIST_DIR}/cmake/env/pol_global_config.h.in
${PROJECT_BINARY_DIR}/pol_global_config.h
)
#building with ninja disables color without explicit forcing it
if(gcc)
add_compile_options(-fdiagnostics-color=always)
elseif(clang)
add_compile_options(-fcolor-diagnostics)
endif()
endmacro()

macro(hide_cotire)

0 comments on commit c0c1561

Please sign in to comment.
You can’t perform that action at this time.