Turn on optimization by default

This commit is contained in:
Ned Wright 2024-05-27 12:05:16 +00:00
parent 941c641174
commit dc000372c4
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 2.8.4)
project (ngen)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-terminate")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fPIC -Wall -Wno-terminate")
execute_process(COMMAND grep -c "Alpine Linux" /etc/os-release OUTPUT_VARIABLE IS_ALPINE)
if(NOT IS_ALPINE EQUAL "0")

View File

@ -124,7 +124,7 @@ cptestGenerateHex(const std::vector<u_char> &vec, bool print_offsets)
std::string
cptestFnameInExeDir(const std::string &name)
{
auto const &bin_path = ::testing::internal::GetArgvs()[0]; // Internal ugly API.
auto bin_path = ::testing::internal::GetArgvs()[0]; // Internal ugly API.
auto slash = bin_path.rfind('/');
if (slash==string::npos) {
// bin_path contains no dir. So return name with no dir