Skip to content

akerdi/cpp_database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

app

cmake

cmake识别USE_MY_COMPILER

首先在 - config.h.in 设置: #cmakedefine USE_MY_COMPILER 或者 #define USE_MY_COMPILER.

接着 - CMakeLists.txt 中引入定义:

// 试cmake支持定义
option(USE_MY_COMPILER
    "Use provided compiler implementation" ON)
// 生成配置文件
configure_file(
    "${PROJECT_SOURCE_DIR}/config.h.in"
    "${PROJECT_SOURCE_DIR}/config.h"
)

之后就可以使用了: if (DEFINED USE_MY_COMPILER).

引入子库

if (DEFINED USE_MY_COMPILER)
    // 引入头文件
    include_directories("${PROKECT_SOURCE_DIR}/compiler")
    // 包括子目录文件夹
    add_subdirectory(compiler)
    set(EXTRA_LIBS ${EXTRA_LIBS} Compiler)
endif()

// 链接库
target_link_libraries(app ${EXTRA_LIBS})

About

cpp实现B+树基础数据库

Resources

Stars

Watchers

Forks