summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorLibravatar robotanarchy <robotanarchy@bingo-ev.de>2015-12-21 19:09:39 +0100
committerLibravatar robotanarchy <robotanarchy@bingo-ev.de>2015-12-21 19:10:49 +0100
commit03c041dd30315125b72699a90085718ebdc13248 (patch)
treed83e1c0df204e82c8da2c16ca88abdfd5725c667 /CMakeLists.txt
parentuse CMake's FindBacktrace for backtrace feature detection (diff)
downloadsway-03c041dd30315125b72699a90085718ebdc13248.tar.gz
sway-03c041dd30315125b72699a90085718ebdc13248.tar.zst
sway-03c041dd30315125b72699a90085718ebdc13248.zip
add -fPIC flag (position independent code) like in wlc
Linking fails otherwise: Linking C executable ../bin/sway /usr/bin/ld: CMakeFiles/sway.dir/commands.c.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC CMakeFiles/sway.dir/commands.c.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status sway/CMakeFiles/sway.dir/build.make:442: recipe for target 'bin/sway' failed
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cabdc468..bb13ef96 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ add_definitions(-DFALLBACK_CONFIG_DIR=\"${FALLBACK_CONFIG_DIR}\")
9set(CMAKE_C_FLAGS "-g") 9set(CMAKE_C_FLAGS "-g")
10set(CMAKE_C_STANDARD 99) 10set(CMAKE_C_STANDARD 99)
11set(CMAKE_C_EXTENSIONS OFF) 11set(CMAKE_C_EXTENSIONS OFF)
12set(CMAKE_POSITION_INDEPENDENT_CODE ON)
12set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) 13set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
13add_definitions( 14add_definitions(
14 -D_GNU_SOURCE 15 -D_GNU_SOURCE