From 5c7f6504d25cd99ad8cc0a39ab3099ecc0cfa27b Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Thu, 12 May 2022 12:15:30 -0300 Subject: [PATCH] Fix cmake compilation properties For some reason using target_compile_features doesn't properly set up C++17 flags in the generate compile_commands.json, which then breaks clang-complete. Switch to use properties instead, which works. --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41fdebc..b3c0c03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,8 +140,12 @@ if(WARNINGS_AS_ERRORS) target_compile_options(oxenmq PRIVATE -Werror) endif() -target_compile_features(oxenmq PUBLIC cxx_std_17) -set_target_properties(oxenmq PROPERTIES POSITION_INDEPENDENT_CODE ON) +set_target_properties(oxenmq PROPERTIES + POSITION_INDEPENDENT_CODE ON + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) function(link_dep_libs target linktype libdirs) foreach(lib ${ARGN})