From 6db40feaced23cc63854ae80ba955c5d4745922e Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Fri, 11 Jan 2019 12:24:25 +0100 Subject: Build: Add a flag to disable PCH --- CMakeLists.txt | 13 ++++++++++--- src/libslic3r/CMakeLists.txt | 2 +- src/slic3r/CMakeLists.txt | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76c937cae..e2677824c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ option(SLIC3R_GUI "Compile Slic3r with GUI components (OpenGL, wxWidgets)" option(SLIC3R_FHS "Assume Slic3r is to be installed in a FHS directory structure" 0) option(SLIC3R_WX_STABLE "Build against wxWidgets stable (3.0) as oppsed to dev (3.1) on Linux" 0) option(SLIC3R_PROFILE "Compile Slic3r with an invasive Shiny profiler" 0) +option(SLIC3R_PCH "Use precompiled headers" 1) option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1) option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1) option(SLIC3R_PERL_XS "Compile XS Perl module and enable Perl unit and integration tests" 0) @@ -37,6 +38,15 @@ option(SLIC3R_SYNTAXONLY "Only perform source code correctness checking, option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF) option(SLIC3R_BUILD_TESTS "Build unit tests" OFF) +# Print out the SLIC3R_* cache options +get_cmake_property(_cache_vars CACHE_VARIABLES) +list (SORT _cache_vars) +foreach (_cache_var ${_cache_vars}) + if("${_cache_var}" MATCHES "^SLIC3R_") + message(STATUS "${_cache_var}: ${${_cache_var}}") + endif () +endforeach() + if (MSVC) if (SLIC3R_MSVC_COMPILE_PARALLEL) add_compile_options(/MP) @@ -46,7 +56,6 @@ if (MSVC) add_compile_options(-bigobj -Zm316) endif () - # Display and check CMAKE_PREFIX_PATH message(STATUS "SLIC3R_STATIC: ${SLIC3R_STATIC}") if (NOT "${CMAKE_PREFIX_PATH}" STREQUAL "") @@ -65,8 +74,6 @@ foreach (DIR ${PREFIX_PATH_CHECK}) endif () endforeach () -message(STATUS "SLIC3R_FHS: ${SLIC3R_FHS}") - # Add our own cmake module path. list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/) diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 7870bd1fb..c97d3d972 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -171,7 +171,7 @@ add_library(libslic3r STATIC SLA/SLASpatIndex.hpp ) -if (NOT SLIC3R_SYNTAXONLY) +if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY) add_precompiled_header(libslic3r pchheader.hpp FORCEINCLUDE) endif () diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index d79421439..783c65293 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -128,6 +128,6 @@ add_library(libslic3r_gui STATIC ) target_link_libraries(libslic3r_gui libslic3r avrdude imgui) -if (NOT SLIC3R_SYNTAXONLY) +if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY) add_precompiled_header(libslic3r_gui pchheader.hpp FORCEINCLUDE) endif () -- cgit v1.2.3