2018-12-08 20:10:29 +05:00
|
|
|
|
2022-04-27 16:42:04 +05:00
|
|
|
add_library(ngcore ${NGCORE_LIBRARY_TYPE}
|
2019-07-09 21:07:19 +05:00
|
|
|
archive.cpp
|
2019-08-28 17:10:09 +05:00
|
|
|
bitarray.cpp
|
2019-09-23 17:01:35 +05:00
|
|
|
exception.cpp
|
2019-07-09 21:07:19 +05:00
|
|
|
localheap.cpp
|
|
|
|
logging.cpp
|
2019-08-06 17:16:13 +05:00
|
|
|
flags.cpp
|
2019-07-09 21:07:19 +05:00
|
|
|
paje_trace.cpp
|
|
|
|
profiler.cpp
|
2019-08-29 17:21:18 +05:00
|
|
|
table.cpp
|
2019-07-09 21:07:19 +05:00
|
|
|
taskmanager.cpp
|
|
|
|
utils.cpp
|
2020-07-23 22:04:21 +05:00
|
|
|
version.cpp
|
2019-07-09 21:07:19 +05:00
|
|
|
)
|
2018-12-28 17:43:15 +05:00
|
|
|
|
2022-09-20 13:53:12 +05:00
|
|
|
string(REPLACE "|" ";" ng_compile_flags_replace_sep "${NG_COMPILE_FLAGS}")
|
2022-09-16 20:13:03 +05:00
|
|
|
target_compile_options(ngcore PUBLIC ${ng_compile_flags_replace_sep})
|
2020-10-01 16:35:53 +05:00
|
|
|
|
2023-07-28 16:01:41 +05:00
|
|
|
if(EMSCRIPTEN)
|
2023-09-05 20:13:29 +05:00
|
|
|
set(PYTHON_MODULE_EXTENSION ".so")
|
2023-08-28 13:02:22 +05:00
|
|
|
target_link_options(ngcore PUBLIC -sALLOW_MEMORY_GROWTH -sENVIRONMENT=web)
|
|
|
|
target_compile_options(ngcore PUBLIC -sNO_DISABLE_EXCEPTION_CATCHING)
|
2023-07-28 16:01:41 +05:00
|
|
|
endif()
|
|
|
|
|
2022-03-14 22:10:47 +05:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9)
|
|
|
|
target_link_libraries(ngcore PUBLIC stdc++fs)
|
|
|
|
endif()
|
2019-08-23 16:26:14 +05:00
|
|
|
|
2019-08-06 18:50:08 +05:00
|
|
|
if(USE_PYTHON)
|
|
|
|
target_sources(ngcore PRIVATE python_ngcore.cpp)
|
2023-02-07 15:59:23 +05:00
|
|
|
target_compile_definitions(ngcore PUBLIC NETGEN_PYTHON NG_PYTHON PYBIND11_SIMPLE_GIL_MANAGEMENT)
|
2019-08-06 18:50:08 +05:00
|
|
|
endif(USE_PYTHON)
|
|
|
|
|
2019-08-28 21:41:42 +05:00
|
|
|
if(WIN32)
|
2020-01-17 03:58:56 +05:00
|
|
|
target_compile_options(ngcore PUBLIC /bigobj /MP /W1 /wd4068)
|
|
|
|
get_WIN32_WINNT(ver)
|
2021-10-27 19:50:07 +05:00
|
|
|
target_compile_definitions(ngcore PUBLIC _WIN32_WINNT=${ver} WNT WNT_WINDOW NOMINMAX MSVC_EXPRESS _CRT_SECURE_NO_WARNINGS HAVE_STRUCT_TIMESPEC WIN32)
|
2020-01-17 03:58:56 +05:00
|
|
|
target_link_options(ngcore PUBLIC /ignore:4273 /ignore:4217 /ignore:4049)
|
2019-08-28 21:41:42 +05:00
|
|
|
endif(WIN32)
|
|
|
|
|
2020-01-17 03:58:56 +05:00
|
|
|
target_compile_definitions(ngcore PRIVATE NGCORE_EXPORTS)
|
2019-10-30 17:56:49 +05:00
|
|
|
target_include_directories(ngcore INTERFACE $<INSTALL_INTERFACE:${NG_INSTALL_DIR_INCLUDE}> $<INSTALL_INTERFACE:${NG_INSTALL_DIR_INCLUDE}/include>)
|
2019-01-02 20:30:55 +05:00
|
|
|
|
2023-02-07 15:59:23 +05:00
|
|
|
if(CHECK_RANGE)
|
2019-01-02 20:30:55 +05:00
|
|
|
target_compile_definitions(ngcore PUBLIC NETGEN_ENABLE_CHECK_RANGE)
|
2023-02-07 15:59:23 +05:00
|
|
|
endif(CHECK_RANGE)
|
|
|
|
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG")
|
|
|
|
target_compile_definitions(ngcore PUBLIC _DEBUG NETGEN_ENABLE_CHECK_RANGE)
|
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG")
|
2019-01-02 20:30:55 +05:00
|
|
|
|
2022-04-08 15:51:23 +05:00
|
|
|
if(TRACE_MEMORY)
|
2020-11-21 19:49:07 +05:00
|
|
|
target_compile_definitions(ngcore PUBLIC NETGEN_TRACE_MEMORY)
|
2022-04-08 15:51:23 +05:00
|
|
|
endif(TRACE_MEMORY)
|
2020-11-21 19:49:07 +05:00
|
|
|
|
2020-03-25 14:40:12 +05:00
|
|
|
if(USE_NUMA)
|
|
|
|
find_library(NUMA_LIBRARY libnuma.so)
|
|
|
|
target_compile_definitions(ngcore PUBLIC USE_NUMA)
|
|
|
|
target_link_libraries(ngcore PRIVATE ${NUMA_LIBRARY})
|
|
|
|
endif(USE_NUMA)
|
|
|
|
|
2018-12-03 20:28:04 +05:00
|
|
|
install(TARGETS ngcore DESTINATION ${NG_INSTALL_DIR} COMPONENT netgen)
|
|
|
|
|
2020-12-18 15:05:10 +05:00
|
|
|
target_link_libraries(ngcore PUBLIC netgen_mpi PRIVATE "$<BUILD_INTERFACE:netgen_python>" ${CMAKE_THREAD_LIBS_INIT})
|
2018-12-21 20:03:44 +05:00
|
|
|
|
2021-05-30 21:32:42 +05:00
|
|
|
install(FILES ngcore.hpp archive.hpp type_traits.hpp version.hpp ngcore_api.hpp logging.hpp memtracer.hpp
|
2019-02-12 00:01:07 +05:00
|
|
|
exception.hpp symboltable.hpp paje_trace.hpp utils.hpp profiler.hpp mpi_wrapper.hpp
|
2019-08-06 17:16:13 +05:00
|
|
|
array.hpp taskmanager.hpp concurrentqueue.h localheap.hpp python_ngcore.hpp flags.hpp
|
2021-09-06 19:59:48 +05:00
|
|
|
xbool.hpp signal.hpp bitarray.hpp table.hpp hashtable.hpp ranges.hpp ngstream.hpp
|
2021-01-31 00:05:28 +05:00
|
|
|
simd.hpp simd_avx.hpp simd_avx512.hpp simd_generic.hpp simd_sse.hpp simd_arm64.hpp
|
2023-09-29 13:56:16 +05:00
|
|
|
register_archive.hpp autodiff.hpp autodiffdiff.hpp
|
2018-12-08 20:10:29 +05:00
|
|
|
DESTINATION ${NG_INSTALL_DIR_INCLUDE}/core COMPONENT netgen_devel)
|
|
|
|
|
|
|
|
if(ENABLE_CPP_CORE_GUIDELINES_CHECK)
|
|
|
|
set_target_properties(ngcore PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}")
|
|
|
|
endif(ENABLE_CPP_CORE_GUIDELINES_CHECK)
|
2018-12-28 17:43:15 +05:00
|
|
|
|
2020-05-18 18:55:40 +05:00
|
|
|
add_dependencies(ngcore ng_generate_version_file)
|
|
|
|
|
2018-12-28 17:43:15 +05:00
|
|
|
if(USE_PYTHON)
|
2023-08-30 20:31:58 +05:00
|
|
|
pybind11_add_module(pyngcore MODULE python_ngcore_export.cpp)
|
2019-11-27 00:26:18 +05:00
|
|
|
target_link_libraries(pyngcore PUBLIC ngcore netgen_python)
|
2022-02-16 13:44:00 +05:00
|
|
|
set_target_properties(pyngcore PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/../${NETGEN_PYTHON_RPATH}")
|
2023-09-06 19:27:27 +05:00
|
|
|
if(EMSCRIPTEN)
|
|
|
|
target_compile_definitions(pyngcore PRIVATE NGCORE_EXPORTS)
|
|
|
|
endif(EMSCRIPTEN)
|
2022-02-07 23:04:26 +05:00
|
|
|
install(TARGETS pyngcore DESTINATION ${NG_INSTALL_DIR_PYTHON}/pyngcore COMPONENT netgen)
|
2018-12-28 17:43:15 +05:00
|
|
|
endif(USE_PYTHON)
|
|
|
|
|