尝试修复linux下编译问题

This commit is contained in:
xiongziliang 2019-12-18 10:37:23 +08:00
parent 97bf82e54c
commit 239dc309f2
2 changed files with 1 additions and 4 deletions

View File

@ -20,6 +20,7 @@ set(RELEASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/release)
if (CMAKE_SYSTEM_NAME MATCHES "Linux") if (CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(LIBRARY_OUTPUT_PATH ${RELEASE_DIR}/linux/${BuildType}) SET(LIBRARY_OUTPUT_PATH ${RELEASE_DIR}/linux/${BuildType})
SET(EXECUTABLE_OUTPUT_PATH ${RELEASE_DIR}/linux/${BuildType}) SET(EXECUTABLE_OUTPUT_PATH ${RELEASE_DIR}/linux/${BuildType})
add_compile_options(-fPIC)
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
SET(LIBRARY_OUTPUT_PATH ${RELEASE_DIR}/windows/${BuildType}) SET(LIBRARY_OUTPUT_PATH ${RELEASE_DIR}/windows/${BuildType})
SET(EXECUTABLE_OUTPUT_PATH ${RELEASE_DIR}/windows/${BuildType}) SET(EXECUTABLE_OUTPUT_PATH ${RELEASE_DIR}/windows/${BuildType})

View File

@ -2,10 +2,6 @@
file(GLOB api_src_list include/*.h source/*.cpp source/*.h source/*.c) file(GLOB api_src_list include/*.h source/*.cpp source/*.h source/*.c)
add_library(api SHARED ${api_src_list}) add_library(api SHARED ${api_src_list})
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_compile_options(-fPIC)
endif()
if(WIN32) if(WIN32)
add_definitions(-DMediaKitApi_EXPORTS) add_definitions(-DMediaKitApi_EXPORTS)
endif() endif()