mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2024-11-29 01:33:46 +00:00
travis is not getting the -fPIC right for pq it seems.
Also make top-level cmake file default to Release if no build type is given.
This commit is contained in:
parent
06abcab627
commit
f28ff13492
2 changed files with 16 additions and 3 deletions
|
@ -15,6 +15,15 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "King_DuckZ")
|
||||||
set(CPACK_PACKAGE_NAME "${bare_name}")
|
set(CPACK_PACKAGE_NAME "${bare_name}")
|
||||||
set(CPACK_STRIP_FILES ON)
|
set(CPACK_STRIP_FILES ON)
|
||||||
|
|
||||||
|
#Make sure this is either Debug or Release
|
||||||
|
set(DINDEXER_SUPPORTED_BUILD_TYPES "Debug;Release")
|
||||||
|
list(FIND DINDEXER_SUPPORTED_BUILD_TYPES "${CMAKE_BUILD_TYPE}" build_type_index)
|
||||||
|
if (${build_type_index} LESS 0)
|
||||||
|
message(STATUS "Forcing build type to Release")
|
||||||
|
set(CMAKE_BUILD_TYPE "Release")
|
||||||
|
endif()
|
||||||
|
unset(build_type_index)
|
||||||
|
|
||||||
include(GetGitRevisionDescription)
|
include(GetGitRevisionDescription)
|
||||||
include(Buildlibpqtypes)
|
include(Buildlibpqtypes)
|
||||||
include(gccversion)
|
include(gccversion)
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
project(${bare_name}-pq CXX)
|
project(${bare_name}-pq CXX)
|
||||||
|
|
||||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC")
|
|
||||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC")
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} STATIC
|
add_library(${PROJECT_NAME} STATIC
|
||||||
connection.cpp
|
connection.cpp
|
||||||
databaseexception.cpp
|
databaseexception.cpp
|
||||||
|
@ -30,3 +27,10 @@ target_compile_features(${PROJECT_NAME}
|
||||||
# RUNTIME DESTINATION bin
|
# RUNTIME DESTINATION bin
|
||||||
# ARCHIVE DESTINATION lib/static
|
# ARCHIVE DESTINATION lib/static
|
||||||
#)
|
#)
|
||||||
|
|
||||||
|
#Allow linking with .so
|
||||||
|
#see https://cmake.org/pipermail/cmake/2007-May/014350.html
|
||||||
|
#and http://stackoverflow.com/questions/6093547/what-do-r-x86-64-32s-and-r-x86-64-64-relocation-mean/6093910#6093910
|
||||||
|
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in a new issue