From 5e423a44b2dc463201cb5b85a64c1b654f5649a7 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Tue, 1 Oct 2024 19:25:18 +0800 Subject: [PATCH] update --- CMakeLists.txt | 26 +++++++++++++------------- README.md | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d028891..8281d1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,30 +4,30 @@ project(dna LANGUAGES CXX) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -if(CMAKE_BUILD_TYPE STREQUAL Release) - Message("It's in [Release] mode") -else() - Message("It's in [Debug] mode") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) endif() +message("It's in [${CMAKE_BUILD_TYPE}] mode") + set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +find_package(OpenMP REQUIRED) +if(MSVC) + add_compile_options(-openmp:llvm) +else() + add_compile_options(-fopenmp) + link_libraries(OpenMP::OpenMP_CXX) +endif() add_subdirectory(pybind11) include_directories(src/tools) -if(MSVC) - add_compile_options(/openmp:llvm) -else() - add_compile_options(-fopenmp) - add_link_options(-fopenmp) -endif() - - file(GLOB_RECURSE SRC CONFIGURE_DEPENDS src/*.cpp src/*.h src/*.hpp) - add_executable(${PROJECT_NAME}_bin ${SRC}) pybind11_add_module(${PROJECT_NAME} ${SRC}) diff --git a/README.md b/README.md index 12d60b5..1e681c5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ git clone --recurse-submodules https://git.zziyu.cn/Zengtudor/DNASequence.git # cmake构建 cmake -B build -DCMAKE_BUILD_TYPE=Release -cmake --build build +cmake --build build --config Release #xmake构建