Skip to content

Commit 9c2d6b8

Browse files
fix: missing fPIC compile
1 parent a25bd9a commit 9c2d6b8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithD
2525
# Debug: No optimization (-O0), full debug info (-g)
2626
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -D_CFDESKTOPDEBUG" CACHE STRING "Flags used by the C++ compiler during Debug builds" FORCE)
2727
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "" CACHE STRING "Linker flags used during Debug builds" FORCE)
28-
28+
# For Static Library Relocatable
29+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2930
# Release: Maximum optimization (-O3), no debug info
3031
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "Flags used by the C++ compiler during Release builds" FORCE)
3132
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" CACHE STRING "Linker flags used during Release builds" FORCE)

0 commit comments

Comments
 (0)