Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ output/
build/
.vscode/
venv/
*.so
venv_dry/
*.mp4
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ find_package(pybind11 REQUIRED)

# Create platform-agnostic core library
add_library(core STATIC HGD/motion/core.cpp HGD/motion/stress.cpp)

# === 【關鍵修改】加入這一行來解決 -fPIC 錯誤 ===
set_target_properties(core PROPERTIES POSITION_INDEPENDENT_CODE ON)
# ============================================

target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/HGD/motion)
target_compile_features(core PUBLIC cxx_std_14)

Expand All @@ -20,4 +25,4 @@ target_compile_options(d2q4_cpp PRIVATE -O3 -march=native)
# Ensure the module is placed inside HGD/motion/
set_target_properties(d2q4_cpp PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/HGD/motion
)
)
Loading
Loading