@@ -15,21 +15,23 @@ set(CMAKE_CXX_COMPILER_TARGET ${TRIPLE})
1515set (CMAKE_C_COMPILER_TARGET ${TRIPLE} )
1616message (STATUS "Target triple ${TRIPLE} " )
1717
18+ # defines $CAPABS depending on installation
19+ include (${CMAKE_CURRENT_LIST_DIR} /settings.cmake )
20+
1821# Arch-specific defines & options
1922if ("${ARCH} " STREQUAL "x86_64" )
2023 set (ARCH_INTERNAL "ARCH_X64" )
2124 set (CMAKE_ASM_NASM_OBJECT_FORMAT "elf64" )
2225 set (OBJCOPY_TARGET "elf64-x86-64" )
26+ set (CAPABS "${CAPABS} -m64" )
2327else ()
2428 set (ARCH_INTERNAL "ARCH_X86" )
2529 set (CMAKE_ASM_NASM_OBJECT_FORMAT "elf" )
2630 set (OBJCOPY_TARGET "elf32-i386" )
31+ set (CAPABS "${CAPABS} -m32" )
2732endif ()
2833enable_language (ASM_NASM )
2934
30- # defines $CAPABS depending on installation
31- include (${CMAKE_CURRENT_LIST_DIR} /settings.cmake )
32-
3335# Various global defines
3436# * OS_TERMINATE_ON_CONTRACT_VIOLATION provides classic assert-like output from Expects / Ensures
3537# * _GNU_SOURCE enables POSIX-extensions in newlib, such as strnlen. ("everything newlib has", ref. cdefs.h)
@@ -46,8 +48,8 @@ if (debug)
4648endif ()
4749
4850if (CMAKE_COMPILER_IS_GNUCC)
49- set (CMAKE_CXX_FLAGS "-m32 - MMD ${CAPABS} ${WARNS} -nostdlib -fno-omit-frame-pointer -c -std=c++14 -D_LIBCPP_HAS_NO_THREADS=1" )
50- set (CMAKE_C_FLAGS "-m32 - MMD ${CAPABS} ${WARNS} -nostdlib -fno-omit-frame-pointer -c" )
51+ set (CMAKE_CXX_FLAGS "-MMD ${CAPABS} ${WARNS} -nostdlib -fno-omit-frame-pointer -c -std=c++14 -D_LIBCPP_HAS_NO_THREADS=1" )
52+ set (CMAKE_C_FLAGS "-MMD ${CAPABS} ${WARNS} -nostdlib -fno-omit-frame-pointer -c" )
5153else ()
5254 # these kinda work with llvm
5355 set (CMAKE_CXX_FLAGS "-MMD ${CAPABS} ${OPTIMIZE} ${WARNS} -nostdlib -nostdlibinc -fno-omit-frame-pointer -c -std=c++14 -D_LIBCPP_HAS_NO_THREADS=1" )
0 commit comments