Skip to content

Commit

Permalink
Fix lto, strncpy
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Nov 25, 2024
1 parent 71a6400 commit 9c45399
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions build.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

int main(int argc, char **argv) {
/* Some variables we need */
char *CXXFLAGS = strcpy(calloc(1024, 1), maybe(getenv("CXXFLAGS")));
char *CFLAGS = strcpy(calloc(1024, 1), maybe(getenv("CFLAGS")));
char *LDFLAGS = strcpy(calloc(1024, 1), maybe(getenv("LDFLAGS")));
char *CC = strcpy(calloc(1024, 1), or_else(getenv("CC"), "cc"));
char *CXX = strcpy(calloc(1024, 1), or_else(getenv("CXX"), "g++"));
char *EXEC_SUFFIX = strcpy(calloc(1024, 1), maybe(getenv("EXEC_SUFFIX")));
char *CXXFLAGS = strncpy(calloc(1024, 1), maybe(getenv("CXXFLAGS")), 1024);
char *CFLAGS = strncpy(calloc(1024, 1), maybe(getenv("CFLAGS")), 1024);
char *LDFLAGS = strncpy(calloc(1024, 1), maybe(getenv("LDFLAGS")), 1024);
char *CC = strncpy(calloc(1024, 1), or_else(getenv("CC"), "cc"), 1024);
char *CXX = strncpy(calloc(1024, 1), or_else(getenv("CXX"), "g++"), 1024);
char *EXEC_SUFFIX = strncpy(calloc(1024, 1), maybe(getenv("EXEC_SUFFIX")), 1024);

char *EXAMPLE_FILES[] = {"EchoBody", "HelloWorldThreaded", "Http3Server", "Broadcast", "HelloWorld", "Crc32", "ServerName",
"EchoServer", "BroadcastingEchoServer", "UpgradeSync", "UpgradeAsync", "ParameterRoutes"};
Expand All @@ -17,7 +17,7 @@ int main(int argc, char **argv) {

// By default we use LTO, but Windows does not support it
if (!env_is("WITH_LTO", "0")) {
strcat(CXXFLAGS, " -flto");
strcat(CXXFLAGS, " -flto=auto");
}

// By default we use zlib but you can build without it (disables permessage-deflate)
Expand Down

0 comments on commit 9c45399

Please sign in to comment.