diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-06-24 21:31:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-03-08 09:20:08 +0100 |
| commit | 42d49b34fa87b14484cdb73e5e5babaa26cf30e1 (patch) | |
| tree | 48b2509d11661979e86963b2d97b8b0097f80105 | |
| parent | e475f10dca39b715a09589027452511ac4cd86fb (diff) | |
Hacks to allow OS X build for 32-bit.
| -rw-r--r-- | Makefile | 31 | ||||
| -rw-r--r-- | cscript | 5 | ||||
| -rw-r--r-- | toolchain/osx.cmake | 2 | ||||
| -rw-r--r-- | toolchain/osx32.cmake | 31 |
4 files changed, 50 insertions, 19 deletions
@@ -33,56 +33,53 @@ endef generic: $(call generate_common,$@) -osx: +osx: $(call generate_common,$@) +osx32: + $(call generate_common,$@,-DCMAKE_OSX_ARCHITECTURES=i386) + cortex-m0: $(call generate_common,$@) - + cortex-m0+: $(call generate_common,$@) - + cortex-m3: $(call generate_common,$@) - + cortex-m4: $(call generate_common,$@) - + cortex-m4f: $(call generate_common,$@) - + cortex-m7: $(call generate_common,$@) arm-sim: $(call generate_common,$@) -avrxmega7: +avrxmega7: $(call generate_common,$@) msp430: $(call generate_common,$@) - + mingw: $(call generate_common,$@,-DWIN32=1) - + lib_only: rm -R -f build_lib_only mkdir build_lib_only cd build_lib_only && cmake $(COMMON_DEFINITIONS) -DLIB_ONLY=TRUE .. -all: +all: generic clean: rm -R -f build_* rm -R -f ext_images - -include fs_test.mk - - - - - +include fs_test.mk @@ -24,7 +24,10 @@ def build(target, options): ext = 'so' device = 'dev' elif target.platform == 'osx': - type = 'generic' + if target.bits == 64: + type = 'osx' + else: + type = 'osx32' blockdev = 'linux' ext = 'dylib' device = 'dev' diff --git a/toolchain/osx.cmake b/toolchain/osx.cmake index 43c9ea7..c920710 100644 --- a/toolchain/osx.cmake +++ b/toolchain/osx.cmake @@ -9,7 +9,7 @@ set(AS as) set(AR as) set(OBJCOPY objcopy) set(OBJDUMP objdump) -set(SIZE size) +#set(SIZE size) set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) diff --git a/toolchain/osx32.cmake b/toolchain/osx32.cmake new file mode 100644 index 0000000..c920710 --- /dev/null +++ b/toolchain/osx32.cmake @@ -0,0 +1,31 @@ +# Name of the target +set(CMAKE_SYSTEM_NAME Darwin) +set(CMAKE_SYSTEM_PROCESSOR i386) + +# Toolchain settings +set(CMAKE_C_COMPILER gcc) +set(CMAKE_CXX_COMPILER g++) +set(AS as) +set(AR as) +set(OBJCOPY objcopy) +set(OBJDUMP objdump) +#set(SIZE size) + +set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX}) + +set(CMAKE_C_FLAGS "-std=gnu99 -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags") +set(CMAKE_CXX_FLAGS "-fdata-sections -ffunction-sections" CACHE INTERNAL "cxx compiler flags") +set(CMAKE_ASM_FLAGS "" CACHE INTERNAL "asm compiler flags") +if (APPLE) + set(CMAKE_EXE_LINKER_FLAGS "-dead_strip" CACHE INTERNAL "exe link flags") +else (APPLE) + set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections" CACHE INTERNAL "exe link flags") +endif (APPLE) + +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -ggdb3" CACHE INTERNAL "c debug compiler flags") +SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb3" CACHE INTERNAL "cxx debug compiler flags") +SET(CMAKE_ASM_FLAGS_DEBUG "-g -ggdb3" CACHE INTERNAL "asm debug compiler flags") + +SET(CMAKE_C_FLAGS_RELEASE "-O2 -g -ggdb3" CACHE INTERNAL "c release compiler flags") +SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g -ggdb3" CACHE INTERNAL "cxx release compiler flags") +SET(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm release compiler flags") |
