Merge lp:~pete-woods/indicator-network/fix-cpp14-ftbfs into lp:indicator-network

Proposed by Pete Woods on 2017-01-12
Status: Merged
Approved by: Pete Woods on 2017-01-12
Approved revision: 666
Merged at revision: 666
Proposed branch: lp:~pete-woods/indicator-network/fix-cpp14-ftbfs
Merge into: lp:indicator-network
Prerequisite: lp:~pete-woods/indicator-network/fix-conffile-removal
Diff against target: 48 lines (+12/-6)
2 files modified
CMakeLists.txt (+11/-6)
src/util/CMakeLists.txt (+1/-0)
To merge this branch: bzr merge lp:~pete-woods/indicator-network/fix-cpp14-ftbfs
Reviewer Review Type Date Requested Status
dobey (community) 2017-01-12 Approve on 2017-01-12
Review via email: mp+314639@code.launchpad.net

Commit message

Use modern CMake syntax for setting compiler type to fix FTBFS

Description of the change

Use modern CMake syntax for setting compiler type to fix FTBFS

To post a comment you must log in.
dobey (dobey) wrote :

One in-line and can you also do --fixes=lp:1656043 to get the bug linked?

review: Needs Fixing
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-12-12 11:57:52 +0000
3+++ CMakeLists.txt 2017-01-12 22:00:52 +0000
4@@ -1,5 +1,5 @@
5 project(indicator-network C CXX)
6-cmake_minimum_required(VERSION 2.8.9)
7+cmake_minimum_required(VERSION 3.1)
8
9 string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower)
10
11@@ -83,17 +83,22 @@
12 pkg_check_modules(URL_DISPATCHER REQUIRED url-dispatcher-1)
13 include_directories(${URL_DISPATCHER_INCLUDE_DIRS})
14
15+find_package(Threads REQUIRED)
16+include_directories(${Thread_INCLUDE_DIRS})
17+
18 set(CMAKE_AUTOMOC ON)
19 set(CMAKE_INCLUDE_CURRENT_DIR ON)
20
21 include_directories(${CMAKE_BINARY_DIR})
22
23-set(COMMON_FLAGS "-Wall -Wextra -Wpedantic -fno-permissive -fPIC -fvisibility=hidden -pthread")
24+set(COMMON_FLAGS "-Wall -Wextra -Wpedantic -fno-permissive -fPIC -fvisibility=hidden")
25
26-# "nice bug" in cmake... http://www.cmake.org/Bug/view.php?id=15058
27-# let's not set C_FLAGS as it will break pthreads detection \o/
28-#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${COMMON_FLAGS}")
29-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 ${COMMON_FLAGS} -fno-strict-aliasing -fvisibility-inlines-hidden")
30+set(CMAKE_C_STANDARD 11)
31+set(CMAKE_CXX_STANDARD 14)
32+if(CMAKE_COMPILER_IS_GNUCC)
33+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS}")
34+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}")
35+endif()
36
37 configure_file(
38 "config.h.in"
39
40=== modified file 'src/util/CMakeLists.txt'
41--- src/util/CMakeLists.txt 2016-10-29 20:09:30 +0000
42+++ src/util/CMakeLists.txt 2017-01-12 22:00:52 +0000
43@@ -9,4 +9,5 @@
44 target_link_libraries(
45 util
46 qdbus-stubs
47+ ${CMAKE_THREAD_LIBS_INIT}
48 )

Subscribers

People subscribed via source and target branches