Skip to content

Commit

Permalink
use static lib for python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
koide3 committed May 4, 2024
1 parent 27a2e6c commit b3cb92c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ option(BUILD_PYTHON_BINDINGS "Build python bindings" OFF)
option(BUILD_WITH_MARCH_NATIVE "Build with -march=native" OFF)
option(BUILD_EXT_TESTS "Build test optional libraries" OFF)

option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(CMAKE_POSITION_INDEPENDENT_CODE "Generate position-independent code" ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
Expand Down Expand Up @@ -39,7 +43,7 @@ find_package(assimp QUIET)
add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GL3W)
add_definitions(-DDATA_PATH_GUESS="${CMAKE_SOURCE_DIR}/data")

add_library(gl_imgui SHARED
add_library(gl_imgui
thirdparty/gl3w/gl3w.cpp
thirdparty/imgui/imgui.cpp
thirdparty/imgui/imgui_demo.cpp
Expand Down Expand Up @@ -87,7 +91,7 @@ if(${JPEG_FOUND})
list(APPEND EXTRA_SOURCE src/glk/io/jpeg_io.cpp)
endif()

add_library(iridescence SHARED
add_library(iridescence
src/glk/path_std.cpp
src/glk/mesh.cpp
src/glk/mesh_model.cpp
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def build_extension(self, ext):
cmake_args = [
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}".format(extdir),
"-DBUILD_PYTHON_BINDINGS=ON",
"-DBUILD_SHARED_LIBS=OFF",
"-DPYTHON_EXECUTABLE={}".format(sys.executable),
"-DEXAMPLE_VERSION_INFO={}".format(self.distribution.get_version()),
"-DCMAKE_BUILD_TYPE={}".format(cfg), # not used on MSVC, but no harm
Expand Down

0 comments on commit b3cb92c

Please sign in to comment.