Skip to content

Commit

Permalink
build config: added initial config
Browse files Browse the repository at this point in the history
Signed-off-by: John Sanpe <[email protected]>
  • Loading branch information
sanpeqf authored and ffashion committed Apr 14, 2024
1 parent a75e991 commit 97a8775
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
19 changes: 18 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.25)
project(adbd LANGUAGES C)

include(cmake/bfdev.cmake)
include(cmake/sanitize.cmake)

set(XDBD_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(XDBD_GENERATED_PATH ${PROJECT_BINARY_DIR}/generated)

if(LINUX)
set(XDBD_LINUX TRUE)
elseif(APPLE)
set(XDBD_OSX TRUE)
elseif(WIN32)
set(XDBD_WIN TRUE)
endif()

configure_file(
${XDBD_MODULE_PATH}/xdbd_config.h.in
${XDBD_GENERATED_PATH}/xdbd_config.h
)

set(HEADERS
${PROJECT_SOURCE_DIR}/include/xdbd.h
${PROJECT_SOURCE_DIR}/include/xdbd_config.h
Expand Down Expand Up @@ -38,6 +54,7 @@ set(
)

include_directories(${XADB_INCLUDES})
include_directories(${XDBD_GENERATED_PATH})

add_executable(adbd ${SRCS})

Expand Down
13 changes: 13 additions & 0 deletions cmake/xdbd_config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright(c) 2024 John Sanpe <[email protected]>
*/

#ifndef __XDBD_CONFIG__H__
#define __XDBD_CONFIG__H__

#cmakedefine XDBD_LINUX
#cmakedefine XDBD_OSX
#cmakedefine XDBD_WIN

#endif /* __XDBD_CONFIG__H__ */

0 comments on commit 97a8775

Please sign in to comment.