Skip to content

Commit

Permalink
Update build files
Browse files Browse the repository at this point in the history
* Fix build error on gcc-13
* User can use variables CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR for compile

Signed-off-by: Seonghyun Kim <[email protected]>
  • Loading branch information
ksh8281 authored and clover2123 committed Jul 17, 2023
1 parent 0927db9 commit 2cc4dc0
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 27 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/es-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
brew install cmake ninja pkg-config icu4c
- name: Build x64
env:
BUILD_OPTIONS: -DESCARGOT_ARCH=x64 -DESCARGOT_HOST=darwin -DESCARGOT_MODE=debug -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DESCARGOT_MODE=debug -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
cmake -H. -Bout/mac/x64 $BUILD_OPTIONS
Expand Down Expand Up @@ -109,13 +109,13 @@ jobs:
patch -p0 < wabt_patch
- name: Build x86
env:
BUILD_OPTIONS: -DESCARGOT_ARCH=x86 -DESCARGOT_HOST=linux -DESCARGOT_MODE=debug -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86 -DESCARGOT_MODE=debug -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
CC=clang CXX=clang++ cmake -H. -Bout/clang/x86 $BUILD_OPTIONS
ninja -Cout/clang/x86
- name: Build x64
env:
BUILD_OPTIONS: -DESCARGOT_ARCH=x64 -DESCARGOT_HOST=linux -DESCARGOT_MODE=debug -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DESCARGOT_MODE=debug -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
CC=clang CXX=clang++ cmake -H. -Bout/clang/x64 $BUILD_OPTIONS
ninja -Cout/clang/x64
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
ln -s /usr/bin/clang-12 /usr/bin/clang
ln -s /usr/bin/clang++-12 /usr/bin/clang++
run: |
CC=clang CXX=clang++ cmake -H. -Bout/release -DESCARGOT_ARCH=arm -DESCARGOT_HOST=linux -DESCARGOT_MODE=release -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
CC=clang CXX=clang++ cmake -H. -Bout/release -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
ninja -Cout/release
python3 ./tools/run-tests.py --engine="./out/release/escargot" new-es
Expand All @@ -171,7 +171,7 @@ jobs:
ln -s /usr/bin/clang-12 /usr/bin/clang
ln -s /usr/bin/clang++-12 /usr/bin/clang++
run: |
CC=clang CXX=clang++ cmake -H. -Bout/release -DESCARGOT_ARCH=aarch64 -DESCARGOT_HOST=linux -DESCARGOT_MODE=release -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
CC=clang CXX=clang++ cmake -H. -Bout/release -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
ninja -Cout/release
python3 ./tools/run-tests.py --engine="./out/release/escargot" new-es
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
sdk: "10.0.20348.0"
- name: Build ${{ matrix.arch.cpu }} Release
run: |
CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch.cpu }} -DESCARGOT_ARCH=${{ matrix.arch.cpu }} -DESCARGOT_MODE=release -Bout/ -DESCARGOT_HOST=windows -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=NO -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_BUILD_TYPE=release -DCMAKE_C_FLAGS="${{ matrix.arch.flag }}" -DCMAKE_CXX_FLAGS="${{ matrix.arch.flag }}"
CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch.cpu }} -Bout/ -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=NO -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_BUILD_TYPE=release -DCMAKE_C_FLAGS="${{ matrix.arch.flag }}" -DCMAKE_CXX_FLAGS="${{ matrix.arch.flag }}"
CMake --build out/ --config Release
- name: Run octane
run: |
Expand Down Expand Up @@ -264,7 +264,7 @@ jobs:
sdk: "10.0.20348.0"
- name: Build ${{ matrix.arch }} Release
run: |
CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DESCARGOT_ARCH=${{ matrix.arch }} -DESCARGOT_MODE=release -Bout/ -DESCARGOT_HOST=windows -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release
CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DESCARGOT_ARCH=${{ matrix.arch }} -Bout/ -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release
CMake --build out/ --config Release
# windows internal ICU doesn't support Temporal and intl402 well
# github action windows runner only have 2 CPUs. that's why I disable Atomics(timeout occured with some tests)
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
uwp: true
- name: Build x64 UWP Release
run: |
CMake -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=x64 -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=release -Bout/win64_release_uwp/ -DESCARGOT_HOST=windows -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_TEST=ON
CMake -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=x64 -Bout/win64_release_uwp/ -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_TEST=ON
cmake --build out\win64_release_uwp --config Release
shell: cmd
- uses: ilammy/[email protected]
Expand All @@ -313,7 +313,7 @@ jobs:
sdk: "10.0.20348.0"
- name: Build x86 DLL Release
run: |
CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=x86 -DESCARGOT_ARCH=x86 -DESCARGOT_MODE=release -Bout/win32_release_shared/ -DESCARGOT_HOST=windows -DESCARGOT_OUTPUT=shared_lib -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release
CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=x86 -Bout/win32_release_shared/ -DESCARGOT_OUTPUT=shared_lib -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release
CMake --build out/win32_release_shared --config Release
shell: cmd
- if: ${{ failure() }}
Expand All @@ -340,7 +340,7 @@ jobs:
dpkg -X libicu-dev_70.1-2ubuntu1_i386.deb $GITHUB_WORKSPACE/icu32
- name: Build x86
env:
BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x86 -DESCARGOT_MODE=release -DESCARGOT_THREADING=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86 -DESCARGOT_THREADING=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
export CXXFLAGS="-I$GITHUB_WORKSPACE/icu32/usr/include"
export LDFLAGS="-L$GITHUB_WORKSPACE/icu32/usr/lib/i386-linux-gnu -Wl,-rpath=$GITHUB_WORKSPACE/icu32/usr/lib/i386-linux-gnu"
Expand Down Expand Up @@ -373,7 +373,7 @@ jobs:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
- name: Build x64
env:
BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=release -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
cmake -H. -Bout/release/x64 $BUILD_OPTIONS ${{ matrix.build_opt }}
ninja -Cout/release/x64
Expand Down Expand Up @@ -405,8 +405,8 @@ jobs:
dpkg -X libicu-dev_70.1-2ubuntu1_amd64.deb $GITHUB_WORKSPACE/icu64
- name: Build x86/x64
env:
BUILD_OPTIONS_X86: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x86 -DESCARGOT_MODE=debug -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS_X64: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=debug -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS_X86: -DESCARGOT_MODE=debug -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS_X64: -DESCARGOT_MODE=debug -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
export CXXFLAGS="-I$GITHUB_WORKSPACE/icu32/usr/include"
export LDFLAGS="-L$GITHUB_WORKSPACE/icu32/usr/lib/i386-linux-gnu -Wl,-rpath=$GITHUB_WORKSPACE/icu32/usr/lib/i386-linux-gnu"
Expand Down Expand Up @@ -435,7 +435,7 @@ jobs:
sudo apt-get install -y ninja-build
- name: Build
env:
BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=debug -DESCARGOT_DEBUGGER=1 -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DESCARGOT_MODE=debug -DESCARGOT_DEBUGGER=1 -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
cmake -H. -Bout/debugger $BUILD_OPTIONS
ninja -Cout/debugger
Expand All @@ -456,8 +456,8 @@ jobs:
sudo apt-get install -y ninja-build gcc-multilib g++-multilib
- name: Build x86/x64
env:
BUILD_OPTIONS_X86: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x86 -DESCARGOT_MODE=debug -DESCARGOT_THREADING=1 -DESCARGOT_DEBUGGER=1 -DESCARGOT_OUTPUT=cctest -GNinja
BUILD_OPTIONS_X64: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=debug -DESCARGOT_THREADING=1 -DESCARGOT_DEBUGGER=1 -DESCARGOT_OUTPUT=cctest -GNinja
BUILD_OPTIONS_X86: -DCMAKE_SYSTEM_PROCSEEOR=x86 -DESCARGOT_MODE=debug -DESCARGOT_THREADING=ON -DESCARGOT_DEBUGGER=1 -DESCARGOT_OUTPUT=cctest -GNinja
BUILD_OPTIONS_X64: -DESCARGOT_MODE=debug -DESCARGOT_THREADING=1 -DESCARGOT_DEBUGGER=1 -DESCARGOT_OUTPUT=cctest -GNinja
run: |
cmake -H. -Bout/cctest/x86 $BUILD_OPTIONS_X86
ninja -Cout/cctest/x86
Expand Down Expand Up @@ -486,7 +486,7 @@ jobs:
dpkg -X libicu-dev_70.1-2ubuntu1_amd64.deb $GITHUB_WORKSPACE/icu64
- name: Build x86
env:
BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x86 -DESCARGOT_MODE=debug -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_CODE_CACHE=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86 -DESCARGOT_MODE=debug -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_CODE_CACHE=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
export CXXFLAGS="-I$GITHUB_WORKSPACE/icu32/usr/include"
export LDFLAGS="-L$GITHUB_WORKSPACE/icu32/usr/lib/i386-linux-gnu -Wl,-rpath=$GITHUB_WORKSPACE/icu32/usr/lib/i386-linux-gnu"
Expand All @@ -495,7 +495,7 @@ jobs:
ninja -Cout/codecache/x86
- name: Build x64
env:
BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=debug -DESCARGOT_CODE_CACHE=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DESCARGOT_MODE=debug -DESCARGOT_CODE_CACHE=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
export CXXFLAGS="-I$GITHUB_WORKSPACE/icu64/usr/include"
export LDFLAGS="-L$GITHUB_WORKSPACE/icu64/usr/lib/x86_64-linux-gnu -Wl,-rpath=$GITHUB_WORKSPACE/icu64/usr/lib/x86_64-linux-gnu"
Expand Down Expand Up @@ -547,13 +547,13 @@ jobs:
patch -p0 < wabt_patch
- name: Build x86
env:
BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x86 -DESCARGOT_MODE=debug -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86 -DESCARGOT_MODE=debug -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
cmake -H. -Bout/wasm/x86 $BUILD_OPTIONS
ninja -Cout/wasm/x86
- name: Build x64
env:
BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=debug -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DESCARGOT_MODE=debug -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
cmake -H. -Bout/wasm/x64 $BUILD_OPTIONS
ninja -Cout/wasm/x64
Expand Down
46 changes: 42 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,48 @@ PROJECT (ESCARGOT)
# CONFIGURATION
SET (CMAKE_VERBOSE_MAKEFILE true)

#SET (ESCARGOT_HOST "linux" CACHE STRING "ESCARGOT_HOST")
#SET (ESCARGOT_ARCH "x86" CACHE STRING "ESCARGOT_ARCH")
#SET (ESCARGOT_MODE "release" CACHE STRING "ESCARGOT_MODE")
#SET (ESCARGOT_OUTPUT "shell" CACHE STRING "ESCARGOT_OUTPUT")
MESSAGE(STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME})
MESSAGE(STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR})

IF (NOT DEFINED ESCARGOT_ARCH)
IF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "X86" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86"
OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
SET(ESCARGOT_ARCH "x86")
ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64"
OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "EM64T")
SET(ESCARGOT_ARCH "x64")
ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm32"
OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l")
SET(ESCARGOT_ARCH "arm")
ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
SET(ESCARGOT_ARCH "aarch64")
ENDIF()
ENDIF()

IF (NOT DEFINED ESCARGOT_HOST)
IF (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" OR ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
SET(ESCARGOT_HOST "windows")
ELSEIF (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
SET(ESCARGOT_HOST "android")
ELSEIF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
SET(ESCARGOT_HOST "darwin")
ELSE()
SET(ESCARGOT_HOST "linux")
ENDIF()
ENDIF()

IF (NOT DEFINED ESCARGOT_MODE)
SET (ESCARGOT_MODE "release")
ENDIF()
IF (NOT DEFINED ESCARGOT_OUTPUT)
SET (ESCARGOT_OUTPUT "shell")
ENDIF()


MESSAGE(STATUS "Escargot Arch: " ${ESCARGOT_ARCH})
MESSAGE(STATUS "Escargot Host: " ${ESCARGOT_HOST})
MESSAGE(STATUS "Escargot Mode: " ${ESCARGOT_MODE})
MESSAGE(STATUS "Escargot Output: " ${ESCARGOT_OUTPUT})

SET (ESCARGOT_TARGET escargot)
SET (ESCARGOT_CCTEST_TARGET cctest)
Expand Down
2 changes: 1 addition & 1 deletion build/escargot.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ IF (ESCARGOT_WASM)
ENDIF()

# BUILD
IF (${ESCARGOT_OUTPUT} MATCHES "shell")
IF (${ESCARGOT_OUTPUT} STREQUAL "shell")
ADD_EXECUTABLE (${ESCARGOT_TARGET} ${ESCARGOT_SRC_LIST})

TARGET_LINK_LIBRARIES (${ESCARGOT_TARGET} PRIVATE ${ESCARGOT_LIBRARIES} ${ESCARGOT_LDFLAGS} ${LDFLAGS_FROM_ENV})
Expand Down
4 changes: 2 additions & 2 deletions build/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
-Wno-deprecated-declarations -Wno-unused-function
)
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9)
SET (ESCARGOT_CXXFLAGS ${ESCARGOT_CXXFLAGS} -Wno-attributes -Wno-class-memaccess -Wno-deprecated-copy -Wno-cast-function-type -Wno-stringop-truncation -Wno-pessimizing-move -Wno-mismatched-new-delete)
SET (ESCARGOT_CXXFLAGS ${ESCARGOT_CXXFLAGS} -Wno-attributes -Wno-class-memaccess -Wno-deprecated-copy -Wno-cast-function-type -Wno-stringop-truncation -Wno-pessimizing-move -Wno-mismatched-new-delete -Wno-overloaded-virtual -Wno-dangling-pointer)
endif()
SET (ESCARGOT_CXXFLAGS_DEBUG -O0 -Wall -Wextra -Werror)
SET (ESCARGOT_CXXFLAGS_RELEASE -O2 -fno-stack-protector -fno-omit-frame-pointer)
Expand Down Expand Up @@ -135,7 +135,7 @@ ELSEIF (${ESCARGOT_HOST} STREQUAL "android")
SET (ESCARGOT_BUILD_32BIT ON)
SET (ESCARGOT_CXXFLAGS ${ESCARGOT_CXXFLAGS} -m32 -mfpmath=sse -msse -msse2 -mstackrealign)
SET (ESCARGOT_LDFLAGS -fPIE -pie -llog -Wl,--gc-sections -m32)
ELSEIF (${ESCARGOT_ARCH} STREQUAL "x86_64")
ELSEIF (${ESCARGOT_ARCH} STREQUAL "x86_64" OR ${ESCARGOT_ARCH} STREQUAL "x64")
SET (ESCARGOT_BUILD_64BIT ON)
SET (ESCARGOT_LDFLAGS -fPIE -pie -llog -Wl,--gc-sections)
# bdwgc android amd64 cannot support keeping back ptrs
Expand Down

0 comments on commit 2cc4dc0

Please sign in to comment.