aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCharlie Blake2018-06-13 15:38:20 +0100
committerGitHub2018-06-13 15:38:20 +0100
commitccb1232a48deef855d0e0f3ea0f69382494975cc (patch)
treebcc8fe29ea84abbd6682c1a880064a90dd65f959 /CMakeLists.txt
parentMerge pull request #59 from thecharlesblake/paper-tidy-up (diff)
parentAdd default cache capacity of 100,000,000 (diff)
downloadmetasol-ccb1232a48deef855d0e0f3ea0f69382494975cc.tar.gz
metasol-ccb1232a48deef855d0e0f3ea0f69382494975cc.zip

Merge pull request #60 from thecharlesblake/cache-mem-limit

Cache mem limit

Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 9 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0fcbde8..7c935f4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,15 @@
# File based on https://stackoverflow.com/questions/21163188/most-simple-but-complete-cmake-example
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.9.4)
project(solvitaire)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+# For -flto flag
+include(CheckIPOSupported)
+check_ipo_supported(RESULT supported OUTPUT error)
+
###############################################################################
## source files ###############################################################
###############################################################################
@@ -133,10 +137,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DBOOST_LOG_DYN_LINK -pthread
-Wcast-align -Wcast-qual -Wformat=2 -Winit-self \
-Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept \
-Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow \
--Wstrict-null-sentinel -Werror")
+-Wstrict-null-sentinel") # -Werror
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -s -DNDEBUG -Wl,-O1")
-#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -g -Wl,-O1") # uncomment for profiling
+#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O -fno-inline -fno-inline-functions -g -Wl,-O1") # uncomment for profiling
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto -s -DNDEBUG -Wl,-O1") # uncomment otherwise
###############################################################################
## target definitions #########################################################
@@ -149,6 +153,7 @@ endif()
# add the data to the target, so it becomes visible in some IDE
add_executable(solvitaire ${main} ${sources})
+set_property(TARGET solvitaire PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) # For -flto flag
target_link_libraries(solvitaire LINK_PUBLIC ${Boost_LIBRARIES})
# add a separete executable for the 'suit reduction streamliner' version of the solver