diff --git a/CMakeLists.txt b/CMakeLists.txt index c33dfdd1d..02fa37163 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,8 @@ project (Jerry CXX C ASM) option(STRIP_RELEASE_BINARY "Strip symbols from release binaries" ON) elseif("${PLATFORM}" STREQUAL "DARWIN") + option(ENABLE_LTO "Enable LTO build" OFF) + option(ENABLE_ALL_IN_ONE "Enable ALL_IN_ONE build" ON) set(PLATFORM_EXT "DARWIN") set(EXTERNAL_BUILD FALSE) diff --git a/Makefile b/Makefile index cc1ea7010..9b0d57021 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,8 @@ # Parallel build of several selected targets started manually is not supported. # +export TARGET_NATIVE_SYSTEMS = $(shell uname -s | tr '[:upper:]' '[:lower:]') + # Options # Valgrind VALGRIND ?= OFF @@ -64,7 +66,11 @@ endif # LTO - LTO ?= ON + ifeq ($(TARGET_NATIVE_SYSTEMS),darwin) + LTO ?= OFF + else + LTO ?= ON + endif ifneq ($(LTO),ON) LTO := OFF @@ -77,7 +83,12 @@ endif # All-in-one build - ALL_IN_ONE ?= OFF + ifeq ($(TARGET_NATIVE_SYSTEMS),darwin) + ALL_IN_ONE ?= ON + else + ALL_IN_ONE ?= OFF + endif + ifneq ($(ALL_IN_ONE),ON) ALL_IN_ONE := OFF endif @@ -91,8 +102,6 @@ QLOG := >/dev/null endif -export TARGET_NATIVE_SYSTEMS = $(shell uname -s | tr '[:upper:]' '[:lower:]') - # External build configuration # Flag, indicating whether to use compiler's default libc (YES / NO) USE_COMPILER_DEFAULT_LIBC ?= NO