File: CMakeLists.txt

package info (click to toggle)
emscripten 3.1.69%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 121,872 kB
  • sloc: ansic: 636,110; cpp: 425,974; javascript: 78,401; python: 58,404; sh: 49,154; pascal: 5,237; makefile: 3,365; asm: 2,415; lisp: 1,869
file content (22 lines) | stat: -rw-r--r-- 992 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
project(emscripten_version)

# EMSCRIPTEN_VERSION CMake variable is introduced in Emscripten version 1.38.6,
# so test that the value is at least that new.

if ("${EMSCRIPTEN_VERSION}" VERSION_GREATER 1.38.5)
  message(STATUS "Emscripten version is at least 1.38.6")
else()
  message(FATAL_ERROR "EMSCRIPTEN_VERSION is not present, or is older than 1.38.6: '${EMSCRIPTEN_VERSION}'")
endif()

# A particular gotcha about Emscripten version testing: do not use the following
# code:

#    if (${EMSCRIPTEN_VERSION} VERSION_GREATER "1.38.5")

# because this would fail when running on an Emscripten version older than
# 1.38.6. That is, note the needed double quotes around ${EMSCRIPTEN_VERSION}.
# This is because in older Emscripten versions, the EMSCRIPTEN_VERSION CMake
# variable did not yet exist, so the above if statement would expand to an empty
# left hand side: if ( VERSION_GREATER_EQUAL 1.38.6) which would be a syntax
# error. if ("" VERSION_GREATER_EQUAL 1.38.6) is fine however.