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 87b996e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
20 changes: 18 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
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_CONFIG_LINUX TRUE)
elseif(APPLE)
set(XDBD_CONFIG_OSX TRUE)
elseif(WIN32)
set(XDBD_CONFIG_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
)

set(SRCS
Expand Down Expand Up @@ -38,6 +53,7 @@ set(
)

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

add_executable(adbd ${SRCS})

Expand Down
14 changes: 14 additions & 0 deletions cmake/xdbd_config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* 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_CONFIG_LINUX
#cmakedefine XDBD_CONFIG_OSX
#cmakedefine XDBD_CONFIG_WIN

#define XDBD_HAVE_SELECT 1
#endif /* __XDBD_CONFIG__H__ */
7 changes: 0 additions & 7 deletions include/xdbd_config.h

This file was deleted.

0 comments on commit 87b996e

Please sign in to comment.