feat add POSITION_INDEPENDENT_CODE ON
All checks were successful
rpcrypto-build / build (Debug, himix200.toolchain.cmake) (push) Successful in 1m9s
rpcrypto-build / build (Debug, hisiv510.toolchain.cmake) (push) Successful in 1m11s
rpcrypto-build / build (Release, hisiv510.toolchain.cmake) (push) Successful in 1m9s
rpcrypto-build / build (Release, himix200.toolchain.cmake) (push) Successful in 1m26s
linux-hisiv500-gcc / linux-gcc-hisiv500 (push) Successful in 1m27s
linux-mips64-gcc / linux-gcc-mips64el (push) Successful in 1m28s
linux-x64-gcc / linux-gcc (push) Successful in 1m38s

This commit is contained in:
tqcq 2024-01-24 16:14:04 +08:00
parent 6086d0778e
commit 076464f1d4

View File

@ -26,12 +26,14 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(ULIB_SHARED_LIB)
add_library(${PROJECT_NAME} SHARED "")
else()
add_library(${PROJECT_NAME} STATIC "" src/ulib/system/timer.cpp
src/ulib/system/timer.h)
add_library(${PROJECT_NAME} STATIC "")
endif()
target_sources(${PROJECT_NAME}
PRIVATE
3party/mongoose/mongoose.c
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_sources(
${PROJECT_NAME}
PRIVATE 3party/mongoose/mongoose.c
src/ulib/base/location.cpp
src/ulib/base/location.h
src/ulib/concorrency/barrier.cpp
@ -56,8 +58,7 @@ target_sources(${PROJECT_NAME}
src/ulib/system/thread_pool.h
src/ulib/system/timer.cpp
src/ulib/system/timer.h
src/ulib/utils/utils.cpp
)
src/ulib/utils/utils.cpp)
find_package(Threads REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@ -97,8 +98,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC fmt::fmt jsoncpp_static
target_compile_definitions(${PROJECT_NAME} PRIVATE ULIB_LIBRARY_IMPL)
target_include_directories(
${PROJECT_NAME}
PUBLIC
3party/asio/include
PUBLIC 3party/asio/include
3party/bnflite
3party/eventbus/include
3party/inja
@ -111,8 +111,7 @@ target_include_directories(
3party/rxcpp/Ix/CPP/src
3party/rxcpp/Rx/v2/src
3party/sigslot
src
)
src)
install(TARGETS ${PROJECT_NAME} DESTINATION lib)