diff --git a/cmake/configure.cmake b/cmake/configure.cmake index a30374169b..5096f3f3ff 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -46,7 +46,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-O0 -Wall -g -Wextra -DDEBUG $ENV{CXXFLAGS}") set(CMAKE_C_FLAGS_RELEASE "-g -O3 -DNDEBUG $ENV{CFLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -DNDEBUG $ENV{CXXFLAGS}") -if(NOT ${node_platform} MATCHES "Windows") +if(NOT ${node_platform} MATCHES windows) add_definitions(-D__POSIX__=1) endif() @@ -78,6 +78,7 @@ add_definitions( -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DEV_MULTIPLICITY=0 + -D_FORTIFY_SOURCE=2 ) # set the exec output path to be compatible with the current waf build system diff --git a/cmake/node_build.cmake b/cmake/node_build.cmake index 1f64d49cea..6f02e7d192 100644 --- a/cmake/node_build.cmake +++ b/cmake/node_build.cmake @@ -48,13 +48,10 @@ else() endif() get_directory_property(compile_defs COMPILE_DEFINITIONS) foreach(def ${compile_defs}) - # escape " in CPPFLAGS (-DPLATFORM="${node_platform}" would fuck stuff up - # otherwise) - string(REPLACE "\"" "\\\"" def ${def}) set(CPPFLAGS "${CPPFLAGS} -D${def}") endforeach() -configure_file(src/node_config.h.in ${PROJECT_BINARY_DIR}/src/node_config.h) +configure_file(src/node_config.h.in ${PROJECT_BINARY_DIR}/src/node_config.h ESCAPE_QUOTES) configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/config.h) include_directories(