mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
build: use CMAKE_POSITION_INDEPENDENT_CODE instead of -fPIC (#21947)
It's simpler to let cmake figure out what flags to add to each platforms to create position independent code rather than handling it ourselves. Also remove code that sets POSITION_INDEPENDENT_CODE property on SHARED and MODULE libraries, as it's already on by default.
This commit is contained in:
@@ -12,7 +12,8 @@ set(LUV_CMAKE_ARGS
|
||||
-DWITH_SHARED_LIBUV=ON
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_MODULE=OFF)
|
||||
-DBUILD_MODULE=OFF
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON)
|
||||
|
||||
if(USE_BUNDLED_LUAJIT)
|
||||
list(APPEND LUV_CMAKE_ARGS -DWITH_LUA_ENGINE=LuaJit)
|
||||
@@ -33,16 +34,11 @@ if(USE_BUNDLED_LIBUV)
|
||||
-DLIBUV_LIBRARIES=uv_a)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
list(APPEND LUV_CMAKE_ARGS
|
||||
"-DCMAKE_C_FLAGS:STRING=${LUV_INCLUDE_FLAGS}")
|
||||
else()
|
||||
list(APPEND LUV_CMAKE_ARGS
|
||||
"-DCMAKE_C_FLAGS:STRING=${LUV_INCLUDE_FLAGS} -fPIC")
|
||||
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND
|
||||
(CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly"))
|
||||
list(APPEND LUV_CMAKE_ARGS -DCMAKE_MAKE_PROGRAM=gmake)
|
||||
endif()
|
||||
list(APPEND LUV_CMAKE_ARGS
|
||||
"-DCMAKE_C_FLAGS:STRING=${LUV_INCLUDE_FLAGS}")
|
||||
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" AND
|
||||
(CMAKE_SYSTEM_NAME MATCHES ".*BSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly"))
|
||||
list(APPEND LUV_CMAKE_ARGS -DCMAKE_MAKE_PROGRAM=gmake)
|
||||
endif()
|
||||
|
||||
if(USE_EXISTING_SRC_DIR)
|
||||
|
||||
Reference in New Issue
Block a user