From 06b0111ddc642cb857c8f7a8f9ce19916fb3e850 Mon Sep 17 00:00:00 2001 From: Teon Banek <teon.banek@memgraph.io> Date: Fri, 13 Oct 2017 15:30:06 +0200 Subject: [PATCH] Remove unused stuff from CMakeLists Summary: In the process, make experimental/distributed compilable. Reviewers: mislav.bradac, buda, mferencevic Reviewed By: mislav.bradac Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D906 --- CMakeLists.txt | 101 +++++------------- experimental/CMakeLists.txt | 2 +- experimental/distributed/CMakeLists.txt | 26 +---- experimental/distributed/main.cpp | 3 +- experimental/distributed/src/protocol.hpp | 2 + experimental/distributed/tests/CMakeLists.txt | 11 +- .../distributed/tests/distributed_test.cpp | 6 +- .../distributed/tests/local_memgraph.cpp | 2 +- libs/CMakeLists.txt | 1 - poc/CMakeLists.txt | 1 - tests/CMakeLists.txt | 20 ++-- tests/benchmark/CMakeLists.txt | 2 - tests/concurrent/CMakeLists.txt | 3 - tests/macro_benchmark/CMakeLists.txt | 14 +-- tests/manual/CMakeLists.txt | 1 - tests/property_based/CMakeLists.txt | 1 - tests/stress/CMakeLists.txt | 3 - tests/unit/CMakeLists.txt | 1 - tools/CMakeLists.txt | 8 +- 19 files changed, 54 insertions(+), 154 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65ba81e75..8ae0492e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,10 +64,11 @@ endif() # ----------------------------------------------------------------------------- -# c++14 # TODO: set here 17 once it will be available in the cmake version (3.8) -set(cxx_standard 14) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z -Wall -Wno-c++1z-extensions") +# set(CMAKE_CXX_STANDARD 17) +# set(CMAKE_CXX_STANDARD_REQUIRED ON) +# For now, explicitly set -std= flag for C++17. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z -Wall") # Don't omit frame pointer in RelWithDebInfo, for additional callchain debug. set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-omit-frame-pointer") @@ -112,30 +113,6 @@ message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}") # setup external dependencies ------------------------------------------------- add_subdirectory(libs) -# TODO: is this clang-tidy target needed anymore? -# linter setup (clang-tidy) -# all source files for linting -FILE(GLOB_RECURSE LINTER_SRC_FILES - ${src_dir}/*.cpp - ${CMAKE_SOURCE_DIR}/tests/.cpp - ${CMAKE_SOURCE_DIR}/poc/.cpp -) -MESSAGE(STATUS "All cpp files for linting are: ${LINTER_SRC_FILES}") -# linter target clang-tidy -find_program(CLANG_TIDY "clang-tidy") -if(CLANG_TIDY) - add_custom_target( - clang-tidy - COMMAND /usr/bin/clang-tidy - ${LINTER_SRC_FILES} - -config='' - -- - -std=c++1y - -I${CMAKE_SOURCE_DIR}/include -I${FMT_INCLUDE_DIR} - DEPENDS fmt) -endif() -# ----------------------------------------------------------------------------- - # ndebug option(NDEBUG "No debug" OFF) message(STATUS "NDEBUG: ${NDEBUG} (be careful CMAKE_BUILD_TYPE can also \ @@ -145,22 +122,6 @@ if(NDEBUG) endif() # ----------------------------------------------------------------------------- -# -- GLIBCXX_DEBUG ------------------------------------------------------------ -# glibcxx debug (useful for gdb) -# the problem is that the query engine doesn't work as it should work if -# this flag is present (TODO: figure out why) -option(GLIBCXX_DEBUG "glibc debug" OFF) -message(STATUS "GLIBCXX_DEBUG: ${GLIBCXX_DEBUG} (solves problem with \ -_M_dataplus member during a debugging process)") -if(GLIBCXX_DEBUG) - set(CMAKE_CXX_FLAGS_DEBUG "-D_GLIBCXX_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}") -endif() -# ----------------------------------------------------------------------------- - -# option binaries -# memgraph -option(MEMGRAPH "Build memgraph binary" ON) -message(STATUS "MEMGRAPH binary: ${MEMGRAPH}") # proof of concept option(POC "Build proof of concept binaries" ON) message(STATUS "POC binaries: ${POC}") @@ -247,7 +208,7 @@ set(memgraph_src_files ) # ----------------------------------------------------------------------------- -# memgraph_lib and memgraph_pic depend on these libraries +# memgraph_lib depend on these libraries set(MEMGRAPH_ALL_LIBS stdc++fs Threads::Threads fmt cppitertools antlr_opencypher_parser_lib dl glog gflags) if (READLINE_FOUND) @@ -272,6 +233,7 @@ endif() # ----------------------------------------------------------------------------- # tests +enable_testing() add_subdirectory(tests) # ----------------------------------------------------------------------------- @@ -287,39 +249,26 @@ add_custom_target(memgraph_link_target ALL # ----------------------------------------------------------------------------- # memgraph main executable -if (MEMGRAPH) - add_executable(${MEMGRAPH_BUILD_NAME} ${src_dir}/memgraph_bolt.cpp) - set_property(TARGET ${MEMGRAPH_BUILD_NAME} - PROPERTY CXX_STANDARD ${cxx_standard}) - target_link_libraries(${MEMGRAPH_BUILD_NAME} memgraph_lib) - # Strip the executable in release build. - string(TOLOWER ${CMAKE_BUILD_TYPE} lower_build_type) - if (lower_build_type STREQUAL "release") - add_custom_command(TARGET ${MEMGRAPH_BUILD_NAME} POST_BUILD - COMMAND strip -s ${MEMGRAPH_BUILD_NAME} - COMMENT Stripping symbols and sections from - ${MEMGRAPH_BUILD_NAME}) - endif() - # Install and rename executable to just 'memgraph' Since we have to rename, - # we cannot use the recommended `install(TARGETS ...)`. - install(PROGRAMS ${CMAKE_BINARY_DIR}/${MEMGRAPH_BUILD_NAME} - DESTINATION bin RENAME memgraph) - # Install the config file. - install(FILES ${CMAKE_SOURCE_DIR}/config/community.conf - DESTINATION /etc/memgraph RENAME memgraph.conf) - # Create empty directories for default location of snapshots and logs. - install(CODE "file(MAKE_DIRECTORY \$ENV{DESTDIR}/var/log/memgraph - \$ENV{DESTDIR}/var/lib/memgraph/snapshots)") +add_executable(${MEMGRAPH_BUILD_NAME} ${src_dir}/memgraph_bolt.cpp) +target_link_libraries(${MEMGRAPH_BUILD_NAME} memgraph_lib) +# Strip the executable in release build. +string(TOLOWER ${CMAKE_BUILD_TYPE} lower_build_type) +if (lower_build_type STREQUAL "release") + add_custom_command(TARGET ${MEMGRAPH_BUILD_NAME} POST_BUILD + COMMAND strip -s ${MEMGRAPH_BUILD_NAME} + COMMENT Stripping symbols and sections from + ${MEMGRAPH_BUILD_NAME}) endif() - -# make CLion aware of all source files so we get refactoring etc -# this target won't be built -file(GLOB_RECURSE __SOURCES ${CMAKE_SOURCE_DIR}/src/*.hpp - ${CMAKE_SOURCE_DIR}/src/*.cpp) -add_executable(__refactor_target ${__SOURCES}) -set_target_properties(__refactor_target PROPERTIES EXCLUDE_FROM_ALL 1) - -get_target_cxx_flags(memgraph_lib compile_flags) +# Install and rename executable to just 'memgraph' Since we have to rename, +# we cannot use the recommended `install(TARGETS ...)`. +install(PROGRAMS ${CMAKE_BINARY_DIR}/${MEMGRAPH_BUILD_NAME} + DESTINATION bin RENAME memgraph) +# Install the config file. +install(FILES ${CMAKE_SOURCE_DIR}/config/community.conf + DESTINATION /etc/memgraph RENAME memgraph.conf) +# Create empty directories for default location of snapshots and logs. +install(CODE "file(MAKE_DIRECTORY \$ENV{DESTDIR}/var/log/memgraph + \$ENV{DESTDIR}/var/lib/memgraph/snapshots)") # ---- Setup CPack -------- # General setup diff --git a/experimental/CMakeLists.txt b/experimental/CMakeLists.txt index d666e8e0c..661fee7ad 100644 --- a/experimental/CMakeLists.txt +++ b/experimental/CMakeLists.txt @@ -1,2 +1,2 @@ # distributed -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/distributed) +add_subdirectory(distributed) diff --git a/experimental/distributed/CMakeLists.txt b/experimental/distributed/CMakeLists.txt index fa6818f2d..c077671e5 100644 --- a/experimental/distributed/CMakeLists.txt +++ b/experimental/distributed/CMakeLists.txt @@ -1,26 +1,13 @@ project(distributed) -# threading -find_package(Threads REQUIRED) - # set directory variables set(src_dir ${PROJECT_SOURCE_DIR}/src) set(libs_dir ${PROJECT_SOURCE_DIR}/libs) # includes -include_directories(${libs_dir}/cereal/include) +include_directories(SYSTEM ${libs_dir}/cereal/include) include_directories(${src_dir}) -# totally hacked, no idea why I need to include these again -# TODO: ask teon -include_directories(${CMAKE_SOURCE_DIR}/src) -include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/libs) -# needed to include configured files (plan_compiler_flags.hpp) -set(generated_headers_dir ${CMAKE_BINARY_DIR}/generated_headers) -include_directories(${generated_headers_dir}) -include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/libs/glog/include) -include_directories(SYSTEM ${CMAKE_BINARY_DIR}/libs/gflags/include) - # library from distributed sources file(GLOB_RECURSE src_files ${src_dir}/*.cpp) add_library(distributed_lib STATIC ${src_files}) @@ -28,19 +15,16 @@ add_library(distributed_lib STATIC ${src_files}) ## distributed Memgraph executable set(executable_name main) add_executable(${executable_name} ${PROJECT_SOURCE_DIR}/main.cpp) -target_link_libraries(${executable_name} distributed_lib) -target_link_libraries(${executable_name} memgraph_lib) -target_link_libraries(${executable_name} ${MEMGRAPH_ALL_LIBS}) +target_link_libraries(${executable_name} distributed_lib memgraph_lib) ## dummy distributed Memgraph client set(executable_name main-client) add_executable(${executable_name} ${PROJECT_SOURCE_DIR}/main-client.cpp) -target_link_libraries(${executable_name} distributed_lib) -target_link_libraries(${executable_name} memgraph_lib) -target_link_libraries(${executable_name} ${MEMGRAPH_ALL_LIBS}) +target_link_libraries(${executable_name} distributed_lib memgraph_lib) # tests -add_subdirectory(${PROJECT_SOURCE_DIR}/tests) +enable_testing() +add_subdirectory(tests) # copy test scripts into the build/ directory (for distributed tests) configure_file(${PROJECT_SOURCE_DIR}/tests/start_distributed.py diff --git a/experimental/distributed/main.cpp b/experimental/distributed/main.cpp index bb8d91640..00a0d252a 100644 --- a/experimental/distributed/main.cpp +++ b/experimental/distributed/main.cpp @@ -1,5 +1,6 @@ -#include <iostream> #include <fstream> +#include <iostream> +#include <random> #include <gflags/gflags.h> #include <glog/logging.h> diff --git a/experimental/distributed/src/protocol.hpp b/experimental/distributed/src/protocol.hpp index f69003ad1..c56964dc7 100644 --- a/experimental/distributed/src/protocol.hpp +++ b/experimental/distributed/src/protocol.hpp @@ -70,6 +70,8 @@ class Session { public: Session(Socket &&socket, Data &data); + int Id() const { return socket_.fd(); } + /** * Returns the protocol alive state */ diff --git a/experimental/distributed/tests/CMakeLists.txt b/experimental/distributed/tests/CMakeLists.txt index 3b33507b2..76bd73033 100644 --- a/experimental/distributed/tests/CMakeLists.txt +++ b/experimental/distributed/tests/CMakeLists.txt @@ -1,9 +1,3 @@ -cmake_minimum_required(VERSION 3.1) - -project(memgraph_tests) - -enable_testing() - # set current directory name as a test type get_filename_component(test_type ${CMAKE_CURRENT_SOURCE_DIR} NAME) @@ -23,7 +17,6 @@ foreach(test_cpp ${test_type_cpps}) # build exec file add_executable(${target_name} ${test_cpp}) - set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard}) if(${TEST_COVERAGE}) set_target_properties(${target_name} PROPERTIES COMPILE_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage") set_target_properties(${target_name} PROPERTIES LINK_FLAGS "--coverage -fprofile-arcs -ftest-coverage") @@ -35,9 +28,7 @@ foreach(test_cpp ${test_type_cpps}) set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${exec_name}) # link libraries - target_link_libraries(${target_name} distributed_lib) - target_link_libraries(${target_name} memgraph_lib) - target_link_libraries(${target_name} ${MEMGRAPH_ALL_LIBS}) + target_link_libraries(${target_name} distributed_lib memgraph_lib) # gtest target_link_libraries(${target_name} gtest gtest_main) if(${TEST_COVERAGE}) diff --git a/experimental/distributed/tests/distributed_test.cpp b/experimental/distributed/tests/distributed_test.cpp index f36c6bcd2..a2b684d74 100644 --- a/experimental/distributed/tests/distributed_test.cpp +++ b/experimental/distributed/tests/distributed_test.cpp @@ -1,12 +1,12 @@ -#include "reactors_distributed.hpp" - #include <iostream> #include <fstream> #include <glog/logging.h> +#include "memgraph_config.hpp" +#include "reactors_distributed.hpp" + DEFINE_int64(my_mnid, 0, "Memgraph node id"); // TODO(zuza): this should be assigned by the leader once in the future -DEFINE_string(config_filename, "", "File containing list of all processes"); class MemgraphDistributed { private: diff --git a/experimental/distributed/tests/local_memgraph.cpp b/experimental/distributed/tests/local_memgraph.cpp index 775e843c5..6165e257d 100644 --- a/experimental/distributed/tests/local_memgraph.cpp +++ b/experimental/distributed/tests/local_memgraph.cpp @@ -375,7 +375,7 @@ // } // } - +int main(int, char **) { return 0; } // int main(int argc, char *argv[]) { // //google::InitGoogleLogging(argv[0]); // gflags::ParseCommandLineFlags(&argc, &argv, true); diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index ebf19e136..ac9225823 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 3.1) include(ExternalProject) include(ProcessorCount) diff --git a/poc/CMakeLists.txt b/poc/CMakeLists.txt index 030d916e5..85962d1eb 100644 --- a/poc/CMakeLists.txt +++ b/poc/CMakeLists.txt @@ -18,7 +18,6 @@ foreach(poc_cpp ${poc_cpps}) # build exe file add_executable(${target_name} ${poc_cpp}) - set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard}) # OUTPUT_NAME sets the real name of a target when it is built and can be # used to help create two targets of the same name even though CMake diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 74aa58c2a..e6f5a0970 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,9 +1,3 @@ -cmake_minimum_required(VERSION 3.1) - -project(memgraph_tests) - -enable_testing() - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/test_results/unit) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/test_results/benchmark) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/test_results/property_based) @@ -24,22 +18,22 @@ add_custom_target(test_data include_directories(${GTEST_INCLUDE_DIR}) # benchmark test binaries -add_subdirectory(${PROJECT_SOURCE_DIR}/benchmark) +add_subdirectory(benchmark) # macro_benchmark test binaries -add_subdirectory(${PROJECT_SOURCE_DIR}/macro_benchmark) +add_subdirectory(macro_benchmark) # stress test binaries -add_subdirectory(${PROJECT_SOURCE_DIR}/stress) +add_subdirectory(stress) # concurrent test binaries -add_subdirectory(${PROJECT_SOURCE_DIR}/concurrent) +add_subdirectory(concurrent) # manual test binaries -add_subdirectory(${PROJECT_SOURCE_DIR}/manual) +add_subdirectory(manual) # unit test binaries -add_subdirectory(${PROJECT_SOURCE_DIR}/unit) +add_subdirectory(unit) # property based test binaries -add_subdirectory(${PROJECT_SOURCE_DIR}/property_based) +add_subdirectory(property_based) diff --git a/tests/benchmark/CMakeLists.txt b/tests/benchmark/CMakeLists.txt index 6a1bd32f0..37f380df8 100644 --- a/tests/benchmark/CMakeLists.txt +++ b/tests/benchmark/CMakeLists.txt @@ -1,4 +1,3 @@ -find_package(Threads REQUIRED) include_directories(${BENCHMARK_INCLUDE_DIR}) # set current directory name as a test type @@ -18,7 +17,6 @@ foreach(test_cpp ${test_type_cpps}) # build exec file add_executable(${target_name} ${test_cpp}) - set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard}) # OUTPUT_NAME sets the real name of a target when it is built and can be # used to help create two targets of the same name even though CMake diff --git a/tests/concurrent/CMakeLists.txt b/tests/concurrent/CMakeLists.txt index d4a097f7c..8c023e3d1 100644 --- a/tests/concurrent/CMakeLists.txt +++ b/tests/concurrent/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(Threads REQUIRED) - # set current directory name as a test type get_filename_component(test_type ${CMAKE_CURRENT_SOURCE_DIR} NAME) @@ -17,7 +15,6 @@ foreach(test_cpp ${test_type_cpps}) # build exec file add_executable(${target_name} ${test_cpp}) - set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard}) # OUTPUT_NAME sets the real name of a target when it is built and can be # used to help create two targets of the same name even though CMake diff --git a/tests/macro_benchmark/CMakeLists.txt b/tests/macro_benchmark/CMakeLists.txt index f338d4f18..202bf0140 100644 --- a/tests/macro_benchmark/CMakeLists.txt +++ b/tests/macro_benchmark/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(Threads REQUIRED) - # set current directory name as a test type get_filename_component(test_type ${CMAKE_CURRENT_SOURCE_DIR} NAME) @@ -7,8 +5,9 @@ get_filename_component(test_type ${CMAKE_CURRENT_SOURCE_DIR} NAME) file(GLOB_RECURSE test_type_cpps *.cpp) message(STATUS "Available ${test_type} cpp files are: ${test_type_cpps}") -# postgres directory -set(postgres_dir ${libs_dir}/postgresql) +add_library(postgres SHARED IMPORTED) +set_property(TARGET postgres PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${libs_dir}/postgresql/include) +set_property(TARGET postgres PROPERTY IMPORTED_LOCATION ${libs_dir}/postgresql/lib/libpq.so) # add target that depends on all other targets set(all_targets_target memgraph__${test_type}) @@ -24,7 +23,6 @@ foreach(test_cpp ${test_type_cpps}) # build exec file add_executable(${target_name} ${test_cpp}) - set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard}) # OUTPUT_NAME sets the real name of a target when it is built and can be # used to help create two targets of the same name even though CMake @@ -32,11 +30,7 @@ foreach(test_cpp ${test_type_cpps}) set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${exec_name}) # link libraries - target_link_libraries(${target_name} memgraph_lib) - - # libpq includes - target_link_libraries(${target_name} "${postgres_dir}/lib/libpq.so") - target_include_directories(${target_name} PUBLIC "${postgres_dir}/include") + target_link_libraries(${target_name} memgraph_lib postgres) # add target to dependencies add_dependencies(${all_targets_target} ${target_name}) diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt index 8d50368c3..d830bbada 100644 --- a/tests/manual/CMakeLists.txt +++ b/tests/manual/CMakeLists.txt @@ -15,7 +15,6 @@ foreach(test_cpp ${test_type_cpps}) # build exec file add_executable(${target_name} ${test_cpp}) - set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard}) # OUTPUT_NAME sets the real name of a target when it is built and can be # used to help create two targets of the same name even though CMake diff --git a/tests/property_based/CMakeLists.txt b/tests/property_based/CMakeLists.txt index d04567350..bb1f7c478 100644 --- a/tests/property_based/CMakeLists.txt +++ b/tests/property_based/CMakeLists.txt @@ -15,7 +15,6 @@ foreach(test_cpp ${test_type_cpps}) # build exec file add_executable(${target_name} ${test_cpp}) - set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard}) # OUTPUT_NAME sets the real name of a target when it is built and can be # used to help create two targets of the same name even though CMake diff --git a/tests/stress/CMakeLists.txt b/tests/stress/CMakeLists.txt index a41dbe2ec..6e09f79a8 100644 --- a/tests/stress/CMakeLists.txt +++ b/tests/stress/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(Threads REQUIRED) - # set current directory name as a test type get_filename_component(test_type ${CMAKE_CURRENT_SOURCE_DIR} NAME) @@ -21,7 +19,6 @@ foreach(test_cpp ${test_type_cpps}) # build exec file add_executable(${target_name} ${test_cpp}) - set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard}) # OUTPUT_NAME sets the real name of a target when it is built and can be # used to help create two targets of the same name even though CMake diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 44e923b63..c77e6ce50 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -15,7 +15,6 @@ foreach(test_cpp ${test_type_cpps}) # build exec file add_executable(${target_name} ${test_cpp}) - set_property(TARGET ${target_name} PROPERTY CXX_STANDARD ${cxx_standard}) if(TEST_COVERAGE) set_target_properties(${target_name} PROPERTIES COMPILE_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage") set_target_properties(${target_name} PROPERTIES LINK_FLAGS "--coverage -fprofile-arcs -ftest-coverage") diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index b1f04fb1e..abc1a091d 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -22,7 +22,7 @@ endif(CCACHE_FOUND AND USE_CCACHE) set(CMAKE_C_COMPILER "clang") set(CMAKE_CXX_COMPILER "clang++") -project("memgraph_tools") +project(memgraph_tools) # setup CMake module path, defines path for include() and find_package() # https://cmake.org/cmake/help/latest/variable/CMAKE_MODULE_PATH.html @@ -41,10 +41,8 @@ if (READLINE_FOUND) add_definitions(-DHAS_READLINE) endif() -# c++14 -# TODO: set here 17 once it will be available in the cmake version (3.8) -set(cxx_standard 14) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z -Wall -Wno-c++1z-extensions") +# Explicitly set -std= flag for C++17. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z -Wall") # Don't omit frame pointer in RelWithDebInfo, for additional callchain debug. set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-omit-frame-pointer")