Commit 25e37764 authored by cianciosa's avatar cianciosa
Browse files

Add inital C language bindings.

parent 096987ac
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
cmake_minimum_required (VERSION 3.21)

project (rays CXX)
project (graph_framework CXX)

#-------------------------------------------------------------------------------
#  Build Options
@@ -12,6 +12,7 @@ option (USE_CONSTANT_CACHE "Cache the value of constantants in kernel registers.
option (SHOW_USE_COUNT "Add a comment showing the use count in kernel sources." OFF)
option (USE_INDEX_CACHE "Cache index values instead of computing them every time." OFF)
option (USE_VERBOSE "Verbose jit option." OFF)
option (BUILD_C_BINDING "Build C interface" OFF)

#-------------------------------------------------------------------------------
#  Set the cmake module path.
@@ -313,6 +314,9 @@ endif ()
#-------------------------------------------------------------------------------

add_subdirectory (graph_framework)
if (${BUILD_C_BINDING})
    add_subdirectory (graph_c_binding)
endif ()

#-------------------------------------------------------------------------------
#  Setup testing
@@ -338,7 +342,7 @@ macro (add_tool_target target)

    target_link_libraries (${target}
                           PUBLIC
                           rays
                           graph_framework
    )
endmacro ()

+6 −6
Original line number Diff line number Diff line
find_package (NetCDF MODULE REQUIRED)

add_library (rays INTERFACE)
target_compile_features (rays
add_library (graph_framework INTERFACE)
target_compile_features (graph_framework
                         INTERFACE
                         cxx_std_20
)
@@ -14,7 +14,7 @@ execute_process (COMMAND ${Python_EXECUTABLE} get_includes.py --compiler=${CMAKE
                 OUTPUT_STRIP_TRAILING_WHITESPACE
)

target_compile_definitions (rays
target_compile_definitions (graph_framework
                            INTERFACE
                            $<$<PLATFORM_ID:Darwin>:CXX_ARGS="-I${CMAKE_CURRENT_SOURCE_DIR}${jit_include_paths} -fgnuc-version=4.2.1 -std=gnu++2a">
                            $<$<PLATFORM_ID:Linux>:CXX_ARGS="-I${CMAKE_CURRENT_SOURCE_DIR}${jit_include_paths} -std=gnu++2a -fno-use-cxa-atexit">
@@ -28,11 +28,11 @@ target_compile_definitions (rays
                            $<IF:$<BOOL:${USE_VERBOSE}>,USE_VERBOSE=true,USE_VERBOSE=false>
)

target_include_directories (rays
target_include_directories (graph_framework
                            INTERFACE
                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
target_link_libraries (rays
target_link_libraries (graph_framework
                       INTERFACE
                       sanitizer
                       gpu_lib
@@ -41,7 +41,7 @@ target_link_libraries (rays
                       $<$<PLATFORM_ID:Linux>:pthread>
                       llvm_dep
)
target_precompile_headers (rays
target_precompile_headers (graph_framework
                           INTERFACE
                           $<$<BOOL:${USE_PCH}>:$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/arithmetic.hpp>>
                           $<$<BOOL:${USE_PCH}>:$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/backend.hpp>>