Add stack protection flags in the CMakeLists.txt file (only for the GNU and Clang compilers).
This commit is contained in:
parent
aeafd990e4
commit
ad2fcfd746
|
@ -6,6 +6,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|||
set(CMAKE_CXX_FLAGS "-pthread")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
|
||||
if((${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) OR (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang))
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector -fstack-clash-protection -Wall")
|
||||
endif()
|
||||
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fira-loop-pressure -ftree-loop-distribution -floop-interchange -ftree-vectorize -fipa-pta -s")
|
||||
set(CMAKE_CXX_FLAGS "-flto -fno-use-linker-plugin -fwhole-program ${CMAKE_CXX_FLAGS}")
|
||||
|
|
|
@ -18,11 +18,7 @@ pair<LANGUAGE, bool> validLanguage(const string& it) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
pair<LANGUAGE, bool> result {
|
||||
selected,
|
||||
valid
|
||||
};
|
||||
return result;
|
||||
return pair<LANGUAGE, bool>(selected, valid);
|
||||
}
|
||||
|
||||
string transpile(string toTranspile, string language)
|
||||
|
|
Loading…
Reference in New Issue