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,38 +26,39 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(ULIB_SHARED_LIB) if(ULIB_SHARED_LIB)
add_library(${PROJECT_NAME} SHARED "") add_library(${PROJECT_NAME} SHARED "")
else() else()
add_library(${PROJECT_NAME} STATIC "" src/ulib/system/timer.cpp add_library(${PROJECT_NAME} STATIC "")
src/ulib/system/timer.h)
endif() endif()
target_sources(${PROJECT_NAME}
PRIVATE set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
3party/mongoose/mongoose.c
src/ulib/base/location.cpp target_sources(
src/ulib/base/location.h ${PROJECT_NAME}
src/ulib/concorrency/barrier.cpp PRIVATE 3party/mongoose/mongoose.c
src/ulib/concorrency/barrier.h src/ulib/base/location.cpp
src/ulib/concorrency/condition_variable.cpp src/ulib/base/location.h
src/ulib/concorrency/condition_variable.h src/ulib/concorrency/barrier.cpp
src/ulib/concorrency/countdown_latch.cpp src/ulib/concorrency/barrier.h
src/ulib/concorrency/countdown_latch.h src/ulib/concorrency/condition_variable.cpp
src/ulib/concorrency/event.cpp src/ulib/concorrency/condition_variable.h
src/ulib/concorrency/event.h src/ulib/concorrency/countdown_latch.cpp
src/ulib/concorrency/internal/condition_variable_impl.cpp src/ulib/concorrency/countdown_latch.h
src/ulib/concorrency/internal/condition_variable_impl.h src/ulib/concorrency/event.cpp
src/ulib/concorrency/internal/mutex_impl.cpp src/ulib/concorrency/event.h
src/ulib/concorrency/internal/mutex_impl.h src/ulib/concorrency/internal/condition_variable_impl.cpp
src/ulib/concorrency/mutex.cpp src/ulib/concorrency/internal/condition_variable_impl.h
src/ulib/concorrency/mutex.h src/ulib/concorrency/internal/mutex_impl.cpp
src/ulib/status.cpp src/ulib/concorrency/internal/mutex_impl.h
src/ulib/status.h src/ulib/concorrency/mutex.cpp
src/ulib/system/thread.cpp src/ulib/concorrency/mutex.h
src/ulib/system/thread.h src/ulib/status.cpp
src/ulib/system/thread_pool.cpp src/ulib/status.h
src/ulib/system/thread_pool.h src/ulib/system/thread.cpp
src/ulib/system/timer.cpp src/ulib/system/thread.h
src/ulib/system/timer.h src/ulib/system/thread_pool.cpp
src/ulib/utils/utils.cpp src/ulib/system/thread_pool.h
) src/ulib/system/timer.cpp
src/ulib/system/timer.h
src/ulib/utils/utils.cpp)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@ -97,22 +98,20 @@ target_link_libraries(${PROJECT_NAME} PUBLIC fmt::fmt jsoncpp_static
target_compile_definitions(${PROJECT_NAME} PRIVATE ULIB_LIBRARY_IMPL) target_compile_definitions(${PROJECT_NAME} PRIVATE ULIB_LIBRARY_IMPL)
target_include_directories( target_include_directories(
${PROJECT_NAME} ${PROJECT_NAME}
PUBLIC PUBLIC 3party/asio/include
3party/asio/include 3party/bnflite
3party/bnflite 3party/eventbus/include
3party/eventbus/include 3party/inja
3party/inja 3party/argagg/include
3party/argagg/include 3party/mongoose
3party/mongoose 3party/nlohmann
3party/nlohmann 3party/nonstd
3party/nonstd 3party/nonstd/ulib
3party/nonstd/ulib 3party/rpc_core/include
3party/rpc_core/include 3party/rxcpp/Ix/CPP/src
3party/rxcpp/Ix/CPP/src 3party/rxcpp/Rx/v2/src
3party/rxcpp/Rx/v2/src 3party/sigslot
3party/sigslot src)
src
)
install(TARGETS ${PROJECT_NAME} DESTINATION lib) install(TARGETS ${PROJECT_NAME} DESTINATION lib)