From 8d9fee694139567bcdb17bdbc85beda3ba16b031 Mon Sep 17 00:00:00 2001 From: Michael Schwarcz Date: Mon, 14 Nov 2016 17:04:10 +0200 Subject: [PATCH] Fix codelite module test failure - Align clang cflags and cxxflags with gcc --- modules/codelite/codelite_project.lua | 2 +- src/tools/clang.lua | 32 ++++++++++++++++----------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/modules/codelite/codelite_project.lua b/modules/codelite/codelite_project.lua index b1bc9de5..f2f72bbe 100755 --- a/modules/codelite/codelite_project.lua +++ b/modules/codelite/codelite_project.lua @@ -196,7 +196,7 @@ end local toolset = m.getcompiler(cfg) - local cxxflags = table.concat(table.join(toolset.getcflags(cfg), toolset.getcxxflags(cfg), cfg.buildoptions), ";") + local cxxflags = table.concat(table.join(toolset.getcxxflags(cfg), cfg.buildoptions), ";") local cflags = table.concat(table.join(toolset.getcflags(cfg), cfg.buildoptions), ";") local asmflags = "" local pch = "" diff --git a/src/tools/clang.lua b/src/tools/clang.lua index 5d67fbc2..25dd2b9f 100644 --- a/src/tools/clang.lua +++ b/src/tools/clang.lua @@ -41,11 +41,11 @@ -- An array of C compiler flags. -- - clang.cflags = { - architecture = gcc.cflags.architecture, - flags = gcc.cflags.flags, - floatingpoint = gcc.cflags.floatingpoint, - strictaliasing = gcc.cflags.strictaliasing, + clang.shared = { + architecture = gcc.shared.architecture, + flags = gcc.shared.flags, + floatingpoint = gcc.shared.floatingpoint, + strictaliasing = gcc.shared.strictaliasing, optimize = { Off = "-O0", On = "-O2", @@ -54,18 +54,21 @@ Size = "-Os", Speed = "-O3", }, - pic = gcc.cflags.pic, - vectorextensions = gcc.cflags.vectorextensions, - warnings = gcc.cflags.warnings, - symbols = gcc.cflags.symbols + pic = gcc.shared.pic, + vectorextensions = gcc.shared.vectorextensions, + warnings = gcc.shared.warnings, + symbols = gcc.shared.symbols } function clang.getcflags(cfg) + local shared_flags = config.mapFlags(cfg, clang.shared) - local flags = config.mapFlags(cfg, clang.cflags) + -- Just pass through to GCC for now + local cflags = config.mapFlags(cfg, gcc.cflags) + + local flags = table.join(shared_flags, cflags) flags = table.join(flags, clang.getwarnings(cfg)) return flags - end function clang.getwarnings(cfg) @@ -88,11 +91,14 @@ -- function clang.getcxxflags(cfg) + local shared_flags = config.mapFlags(cfg, clang.shared) -- Just pass through to GCC for now - local flags = gcc.getcxxflags(cfg) - return flags + local cxxflags = config.mapFlags(cfg, gcc.cxxflags) + local flags = table.join(shared_flags, cxxflags) + flags = table.join(flags, clang.getwarnings(cfg)) + return flags end