soprano: set proper release/debug flags
@@ -2,14 +2,13 @@ cmake_minimum_required(VERSION 2.8)
project(soprano)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -g")
-
+if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ set(CMAKE_BUILD_TYPE "Debug")
+endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
- set(CMAKE_C_FLAGS "${CMAKE_CXx_FLAGS} -O2")
+ set(CMAKE_C_FLAGS "-Wall -Wextra -fPIC -g -O2")
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
- set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -O0")
+ set(CMAKE_C_FLAGS "-Wall -Wextra -fPIC -g -O0")
endif()
include_directories("${PROJECT_SOURCE_DIR}/src")
@@ -23,4 +22,5 @@ message (STATUS "")
message (STATUS "soprano: PostgreSQL protocol interaction library.")
message (STATUS "")
message (STATUS "BUILD_STATIC: ${BUILD_STATIC}")
+message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message (STATUS "")
