aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/Platform/Emscripten.cmake30
-rw-r--r--tests/cmake/target_js/CMakeLists.txt2
2 files changed, 18 insertions, 14 deletions
diff --git a/cmake/Platform/Emscripten.cmake b/cmake/Platform/Emscripten.cmake
index 082296f2..9bfa829d 100644
--- a/cmake/Platform/Emscripten.cmake
+++ b/cmake/Platform/Emscripten.cmake
@@ -11,8 +11,10 @@
# After that, build the generated Makefile with the command 'make'. On Windows, you may download and use 'mingw32-make' instead.
-# the name of the target operating system
-set(CMAKE_SYSTEM_NAME Emscripten)
+# The following variable describes the target OS we are building to.
+# Ideally, this could be 'Emscripten', but as Emscripten mimics the Linux platform, setting this to Linux will allow more of existing software to build.
+# Be sure to run Emscripten test_openjpeg if planning to change this.
+set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_CROSSCOMPILING TRUE)
@@ -80,18 +82,18 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
-SET(CMAKE_LINK_LIBRARY_SUFFIX "")
-SET(CMAKE_STATIC_LIBRARY_PREFIX "")
-SET(CMAKE_STATIC_LIBRARY_SUFFIX ".bc")
-SET(CMAKE_SHARED_LIBRARY_PREFIX "")
-SET(CMAKE_SHARED_LIBRARY_SUFFIX ".bc")
-IF (NOT CMAKE_EXECUTABLE_SUFFIX)
- SET(CMAKE_EXECUTABLE_SUFFIX ".js")
-endif()
-SET(CMAKE_DL_LIBS "" )
-
-SET(CMAKE_FIND_LIBRARY_PREFIXES "")
-SET(CMAKE_FIND_LIBRARY_SUFFIXES ".bc")
+# We would prefer to specify a standard set of Clang+Emscripten-friendly common convention for suffix files, especially for CMake executable files,
+# but if these are adjusted, ${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake will fail, since it depends on being able to compile output files with predefined names.
+#SET(CMAKE_LINK_LIBRARY_SUFFIX "")
+#SET(CMAKE_STATIC_LIBRARY_PREFIX "")
+#SET(CMAKE_STATIC_LIBRARY_SUFFIX ".bc")
+#SET(CMAKE_SHARED_LIBRARY_PREFIX "")
+#SET(CMAKE_SHARED_LIBRARY_SUFFIX ".bc")
+#IF (NOT CMAKE_EXECUTABLE_SUFFIX)
+# SET(CMAKE_EXECUTABLE_SUFFIX ".js")
+#endif()
+#SET(CMAKE_FIND_LIBRARY_PREFIXES "")
+#SET(CMAKE_FIND_LIBRARY_SUFFIXES ".bc")
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
diff --git a/tests/cmake/target_js/CMakeLists.txt b/tests/cmake/target_js/CMakeLists.txt
index b39ae2b7..cee5fc42 100644
--- a/tests/cmake/target_js/CMakeLists.txt
+++ b/tests/cmake/target_js/CMakeLists.txt
@@ -10,6 +10,8 @@ else() # Either MinSizeRel, RelWithDebInfo or Release, all which run with optimi
SET(linkFlags "-O2")
endif()
+SET(CMAKE_EXECUTABLE_SUFFIX ".js")
+
if (WIN32)
message(FATAL_ERROR "WIN32 should not be defined when cross-compiling!")
endif()