From 7d938b4f63955c2c8b4bcede8022de4536d55653 Mon Sep 17 00:00:00 2001 From: arezaii Date: Mon, 25 Sep 2023 15:27:02 -0600 Subject: [PATCH 1/2] (chpldef): fix cmake cxx standard required Signed-off-by: arezaii --- tools/chpldef/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/chpldef/CMakeLists.txt b/tools/chpldef/CMakeLists.txt index e382a97c6413..2e42ee5135bd 100644 --- a/tools/chpldef/CMakeLists.txt +++ b/tools/chpldef/CMakeLists.txt @@ -15,6 +15,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +# the lanuguage features used in the server require at least c++17 +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) + # Put all the binary source files into an object blob. add_library(chpldef-objects command-line-flags.cpp @@ -37,7 +41,6 @@ target_include_directories(chpldef-objects PRIVATE ${CHPL_MAIN_INCLUDE_DIR} ${CHPL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) -set_property(TARGET chpldef-objects PROPERTY CXX_STANDARD 17) # Create the 'chpldef' executable. add_executable(chpldef chpldef.cpp) @@ -47,7 +50,6 @@ target_include_directories(chpldef PRIVATE ${CHPL_MAIN_INCLUDE_DIR} ${CHPL_INCLUDE_DIR} ${CHPLDEF_INCLUDE_DIR}) -set_property(TARGET chpldef PROPERTY CXX_STANDARD 17) # Enable testing if the test folder exists. if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test") From 1beaff04a1a8a5660a1179472f2f58dd77435081 Mon Sep 17 00:00:00 2001 From: arezaii Date: Mon, 25 Sep 2023 18:54:04 -0600 Subject: [PATCH 2/2] [build]: strip c++14 std from flags if present in cmake Signed-off-by: arezaii --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5dbdd3127f65..dab077caccaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,8 @@ endif() # set(DEBUG OFF CACHE BOOL "DEBUG flag from make") # CMake Debug? # set(PROFILE OFF CACHE BOOL "PROFILE flag from make") +# We set the cxx standard in the sub folders, strip the standard from the bunch of flags we got +string(REPLACE "-std=c++14" "" CHPL_CXX_FLAGS "${CHPL_CXX_FLAGS}") message(VERBOSE "Using C++ compile options ${CHPL_CXX_FLAGS}") message(VERBOSE "Using C++ link options ${CHPL_LD_FLAGS}") @@ -322,6 +324,9 @@ foreach (CHPLENV_LINE IN LISTS CHPLENV_OUTPUT) # message(DEBUG "Setting ${CHPLENV_LINE} as ${CHPL_ENV_NAME} ${CHPL_ENV_VALUE}") set(${CHPL_ENV_NAME} ${CHPL_ENV_VALUE} CACHE STRING "overwritten description" FORCE) endforeach() +# We set the cxx standard in the sub folders, strip the standard from the bunch of flags we got +string(REPLACE "-std=c++14" "" CHPL_HOST_BUNDLED_COMPILE_ARGS "${CHPL_HOST_BUNDLED_COMPILE_ARGS}") +string(REPLACE "-std=c++14" "" CHPL_HOST_SYSTEM_COMPILE_ARGS "${CHPL_HOST_SYSTEM_COMPILE_ARGS}") if ((CHPL_HOME STREQUAL CMAKE_BINARY_DIR) OR (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR))