This commit is contained in:
Zengtudor 2024-10-01 19:25:18 +08:00
parent d4571097ba
commit 5e423a44b2
2 changed files with 14 additions and 14 deletions

View File

@ -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})

View File

@ -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构建