Skip to content

Commit

Permalink
updated .gitignore and added CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Vipul-Cariappa committed Nov 28, 2023
1 parent 5e1d219 commit 32e72ba
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,5 @@ PyC.vcxproj.user
run.sh
premake5.lua
.clangd/
.idea/
cmake-build-debug/
32 changes: 32 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 3.8)

project(PyC)

find_package(PkgConfig REQUIRED)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")

pkg_check_modules(FFI REQUIRED libffi)
pkg_check_modules(PYTHON REQUIRED python3)

add_library(PyC SHARED src/CppTypeInfo.c src/CppWrapper_PyTypes.c src/Py_C_Types.c src/PyC.c src/TypeConversions.c)

target_include_directories(PyC PRIVATE "src/")

target_include_directories(PyC PRIVATE ${PYTHON_INCLUDE_DIRS})
target_link_libraries(PyC ${PYTHON_LIBRARIES})
target_compile_options(PyC PRIVATE ${PYTHON_CFLAGS_OTHER})

target_link_libraries(PyC ${FFI_LIBRARIES})
target_include_directories(PyC PRIVATE ${FFI_INCLUDE_DIRS})
target_compile_options(PyC PRIVATE ${FFI_CFLAGS_OTHER})

target_include_directories(PyC PRIVATE "/usr/lib/llvm-15/include")
target_link_libraries(PyC "clang-15")

project(cmodule)
add_library(cmodule SHARED tests/c/module.c)

project(cppmodule)
add_library(cppmodule SHARED tests/c/module.cpp)

0 comments on commit 32e72ba

Please sign in to comment.