fix: Use -fPIC

This commit is contained in:
SongZihuan 2022-02-08 19:44:49 +08:00
parent 111cd470b5
commit 0322538fbf
1 changed files with 5 additions and 1 deletions

View File

@ -176,7 +176,11 @@ IF (INTEL_CET_ENABLED)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mshstk")
ENDIF(INTEL_CET_ENABLED)
include(CheckCCompilerFlag)
check_c_compiler_flag("-fPIC" FPIC_ENABLED) # fPIC
if (FPIC_ENABLED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif(FPIC_ENABLED)
# User-configurable options
#