From 0875d3523f30c9bdc03e9082b078203bff2bfbd7 Mon Sep 17 00:00:00 2001 From: Jannes Klee Date: Sat, 15 Feb 2025 16:32:21 +0100 Subject: [PATCH 1/2] BLD / two fixes in build process - enable C and CXX as languages which seems to be necessary to compile - set default RELEASE if nothing is set as build type - alternatively the README would need to be changed --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0bcb94..199b8ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required (VERSION 3.14.1) project (FOSITE NONE) +enable_language(CXX) +enable_language(C) + # detect git find_package(Git) if(Git_FOUND) @@ -52,6 +55,7 @@ else() endif() endif() + if(LLVM_FOUND) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION} in ${LLVM_INSTALL_PREFIX}") message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") @@ -71,6 +75,9 @@ endif() # check and set the build type set (CMAKE_BUILD_TYPE_NAMES RELEASE DEBUG PROFILING) set (CMAKE_BUILD_TYPE RELEASE CACHE STRING "Should be one of RELEASE, DEBUG, PROFILING; default: RELEASE") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "Build type" FORCE) +endif() if (NOT CMAKE_BUILD_TYPE IN_LIST CMAKE_BUILD_TYPE_NAMES) message(FATAL_ERROR "Unknown build type, should be one of RELEASE, DEBUG, PROFILING") endif() From 641d205e8eff344bc3046d845edcc8c3bdaf6f34 Mon Sep 17 00:00:00 2001 From: Jannes Klee Date: Sat, 15 Feb 2025 19:41:53 +0100 Subject: [PATCH 2/2] BLD / include suggestion --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 199b8ab..59d7e09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,10 +74,8 @@ endif() # check and set the build type set (CMAKE_BUILD_TYPE_NAMES RELEASE DEBUG PROFILING) -set (CMAKE_BUILD_TYPE RELEASE CACHE STRING "Should be one of RELEASE, DEBUG, PROFILING; default: RELEASE") -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "Build type" FORCE) -endif() +set (CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "Should be one of RELEASE, DEBUG, PROFILING; default: RELEASE" FORCE) +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_BUILD_TYPE_NAMES}) if (NOT CMAKE_BUILD_TYPE IN_LIST CMAKE_BUILD_TYPE_NAMES) message(FATAL_ERROR "Unknown build type, should be one of RELEASE, DEBUG, PROFILING") endif()