3ec600bc7266 — Vesa Norilo 5 months ago
binaryen build improvements
3 files changed, 11 insertions(+), 6 deletions(-)

M cmake/Binaryen.cmake
M config.h.in
M src/driver/kwasm.cpp
M cmake/Binaryen.cmake +4 -4
@@ 7,7 7,7 @@ set(BINARYEN_BUILD_DIR "${EXT_BASE}/Buil
 
 include(ExternalProject)
 
-set(BINARYEN_VERSION version_84)
+set(BINARYEN_VERSION "version_84")
 
 if (EMSCRIPTEN) 
 	set(CMAKE_CMD "emcmake")

          
@@ 23,7 23,7 @@ if (WIN32)
 		SVN_REPOSITORY "https://github.com/WebAssembly/binaryen.git/tags/${BINARYEN_VERSION}"
 		CMAKE_COMMAND "${CMAKE_CMD}"
 		CMAKE_ARGS ${CMAKE_ARGS}
-		BUILD_COMMAND cmake --build "${BINARYEN_BUILD_DIR}" --target binaryen
+		BUILD_COMMAND cmake --build . --target binaryen
 		INSTALL_COMMAND "")
 else()
 	ExternalProject_Add(

          
@@ 32,7 32,7 @@ else()
 		GIT_TAG ${BINARYEN_VERSION}
 		CMAKE_COMMAND "${CMAKE_CMD}"
 		CMAKE_ARGS ${CMAKE_ARGS}
-		BUILD_COMMAND cmake --build "${BINARYEN_BUILD_DIR}" --target binaryen
+		BUILD_COMMAND cmake --build . --target binaryen -- -j4
 		INSTALL_COMMAND "")
 endif()
 

          
@@ 47,7 47,7 @@ foreach(dep binaryen passes wasm asmjs e
 	list(APPEND BINARYEN_LIBRARIES "${PATH}")
 endforeach()
 
-message(STATUS "Linking Binaryen")
+message(STATUS "Linking Binaryen ${BINARYEN_VERSION}")
 add_library(binaryen_backend
 	"src/backends/BinaryenInterface.cpp"
 	"src/backends/BinaryenEmitter.cpp"

          
M config.h.in +2 -1
@@ 18,4 18,5 @@ 
 #cmakedefine HAVE_FMT 1
 #define KRONOS_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}"
 #define KRONOS_SOURCE_REVISION ${KRONOS_LOCAL_REVISION}
-#define KRONOS_BUILD_YEAR "${CURRENT_YEAR}"
  No newline at end of file
+#define KRONOS_BUILD_YEAR "${CURRENT_YEAR}"
+#define BINARYEN_VERSION "${BINARYEN_VERSION}"
  No newline at end of file

          
M src/driver/kwasm.cpp +5 -1
@@ 1,6 1,8 @@ 
 #include "kronos.h"
 #include "picojson.h"
 #include "config/corelib.h"
+#include "config/system.h"
+
 #include <sstream>
 #include <iostream>
 #include <fstream>

          
@@ 155,7 157,9 @@ public:
 	picojson::object errorMessage;
 
 	void Initialize() {
-		std::clog << "Initializing Kronos with [" << KRONOS_CORE_LIBRARY_REPOSITORY << " " << KRONOS_CORE_LIBRARY_VERSION << "]\n";
+		std::clog << "Kronos   [" KRONOS_PACKAGE_VERSION 
+			" (" KRONOS_CORE_LIBRARY_REPOSITORY " " KRONOS_CORE_LIBRARY_VERSION ")]\n";
+		std::clog << "Binaryen [" BINARYEN_VERSION "]\n";
 		cx = CreateContext(PathResolver, this);
 #ifndef NDEBUG
 		std::clog << "[ DEBUG MODE ]\n";