Skip to content
Snippets Groups Projects
Commit a39f0aab authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

feat : added option to build a shared library

parent d5650609
No related branches found
No related tags found
1 merge request!43fix 0.3.1
...@@ -33,6 +33,13 @@ option(WERROR "Warning as error (Default: OFF)" OFF) ...@@ -33,6 +33,13 @@ option(WERROR "Warning as error (Default: OFF)" OFF)
option(TEST "Enable tests (Default: ON)" ON) option(TEST "Enable tests (Default: ON)" ON)
option(COVERAGE "Enable coverage (Default: OFF)" OFF) option(COVERAGE "Enable coverage (Default: OFF)" OFF)
option(ENABLE_ASAN "Enable ASan (AddressSanitizer) for runtime analysis of memory use (over/underflow, memory leak, ...) (Default: OFF)" OFF) option(ENABLE_ASAN "Enable ASan (AddressSanitizer) for runtime analysis of memory use (over/underflow, memory leak, ...) (Default: OFF)" OFF)
option(SHARED_LIBRARY "${module_name} created library will be shared, if off, it will be an archive (Default: OFF)" OFF)
if(SHARED_LIBRARY)
set(LIB_TYPE SHARED)
else(SHARED_LIBRARY)
set(LIB_TYPE STATIC)
endif(SHARED_LIBRARY)
############################################## ##############################################
# Import utils CMakeLists # Import utils CMakeLists
...@@ -90,7 +97,7 @@ enable_language(CUDA) ...@@ -90,7 +97,7 @@ enable_language(CUDA)
file(GLOB_RECURSE src_files "src/*.cpp" "src/*.cu") file(GLOB_RECURSE src_files "src/*.cpp" "src/*.cu")
file(GLOB_RECURSE inc_files "include/*.hpp") file(GLOB_RECURSE inc_files "include/*.hpp")
add_library(${module_name} ${src_files} ${inc_files}) add_library(${module_name} ${LIB_TYPE} ${src_files} ${inc_files})
# PYTHON BINDING # PYTHON BINDING
if (PYBIND) if (PYBIND)
......
...@@ -75,6 +75,7 @@ class CMakeBuild(build_ext): ...@@ -75,6 +75,7 @@ class CMakeBuild(build_ext):
*build_gen, *build_gen,
str(cwd), str(cwd),
"-DTEST=OFF", "-DTEST=OFF",
"-DSHARED_LIB=OFF"
f"-DCMAKE_INSTALL_PREFIX:PATH={install_path}", f"-DCMAKE_INSTALL_PREFIX:PATH={install_path}",
f"-DCMAKE_BUILD_TYPE={compile_type}", f"-DCMAKE_BUILD_TYPE={compile_type}",
"-DPYBIND=ON", "-DPYBIND=ON",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment