From 81c717dbb6e29c9b8fda66c82023853a46148f29 Mon Sep 17 00:00:00 2001 From: DarkCaster Date: Sun, 18 Feb 2018 02:11:58 +0300 Subject: [PATCH] Update build flags definitions for cmake projects --- Executor/CMakeLists.txt | 3 ++- X11Util/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Executor/CMakeLists.txt b/Executor/CMakeLists.txt index 7c7c606..70f2461 100644 --- a/Executor/CMakeLists.txt +++ b/Executor/CMakeLists.txt @@ -44,8 +44,9 @@ include_directories("${CMAKE_BINARY_DIR}") #set flags for gcc if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) #platform dependent gcc flags - set(OPTFLAGS "-fpic -pedantic") + set(OPTFLAGS "-pedantic") #general compiler flags for gcc compiler ##You can enable additional warnings for paranoics: -Wunsuffixed-float-constants -Wpadded set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra -Wshadow -Wstrict-overflow=5 -Wwrite-strings -Winit-self -Wmissing-include-dirs -Wbad-function-cast -Wc++-compat -Wcast-qual -Wcast-align -Wconversion -Wlogical-op -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wdisabled-optimization -Woverlength-strings -Wfloat-equal -Wswitch-default ${OPTFLAGS}") diff --git a/X11Util/CMakeLists.txt b/X11Util/CMakeLists.txt index 75adde7..83a636d 100644 --- a/X11Util/CMakeLists.txt +++ b/X11Util/CMakeLists.txt @@ -44,8 +44,9 @@ include_directories("${CMAKE_BINARY_DIR}") #set flags for gcc if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) #platform dependent gcc flags - set(OPTFLAGS "-fpic -pedantic") + set(OPTFLAGS "-pedantic") #general compiler flags for gcc compiler ##You can enable additional warnings for paranoics: -Wunsuffixed-float-constants -Wpadded set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra -Wshadow -Wstrict-overflow=5 -Wwrite-strings -Winit-self -Wmissing-include-dirs -Wbad-function-cast -Wc++-compat -Wcast-qual -Wcast-align -Wconversion -Wlogical-op -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wdisabled-optimization -Woverlength-strings -Wfloat-equal -Wswitch-default ${OPTFLAGS}")