mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 03:35:38 +03:00
https://github.com/WebAssembly/binaryen Compiler infrastructure and toolchain library for WebAssembly, in C++
85 lines
3.5 KiB
Diff
85 lines
3.5 KiB
Diff
From: Jakub Jirutka <jakub@jirutka.cz>
|
|
Date: Sat, 1 Apr 2017 02:00:34 +0200
|
|
Subject: [PATCH] Fix install locations per FHS and allow to customize them
|
|
|
|
Include built-in cmake module GNUInstallDirs that defines customizable
|
|
CMAKE_INSTALL_* variables with common defaults per FHS.
|
|
|
|
Upstream-Issue: https://github.com/WebAssembly/binaryen/pull/958
|
|
---
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -1,5 +1,6 @@
|
|
PROJECT(binaryen C CXX)
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
|
|
+INCLUDE(GNUInstallDirs)
|
|
|
|
IF(NOT CMAKE_BUILD_TYPE)
|
|
MESSAGE(STATUS "No build type selected, default to Release")
|
|
@@ -138,11 +139,11 @@ ELSE()
|
|
ADD_LIBRARY(binaryen SHARED ${binaryen_SOURCES})
|
|
ENDIF()
|
|
TARGET_LINK_LIBRARIES(binaryen ${all_passes} wasm asmjs ast support)
|
|
-INSTALL(TARGETS binaryen DESTINATION lib)
|
|
+INSTALL(TARGETS binaryen DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
|
|
-INSTALL(FILES src/binaryen-c.h DESTINATION include)
|
|
-INSTALL(FILES bin/wasm.js DESTINATION bin)
|
|
-INSTALL(FILES bin/binaryen.js DESTINATION bin)
|
|
+INSTALL(FILES src/binaryen-c.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
|
+INSTALL(FILES bin/wasm.js DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
|
|
+INSTALL(FILES bin/binaryen.js DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
|
|
INSTALL(DIRECTORY src/js DESTINATION src)
|
|
|
|
SET(wasm-shell_SOURCES
|
|
@@ -154,7 +155,7 @@ ADD_EXECUTABLE(wasm-shell
|
|
TARGET_LINK_LIBRARIES(wasm-shell wasm asmjs emscripten-optimizer ${all_passes} ast support)
|
|
SET_PROPERTY(TARGET wasm-shell PROPERTY CXX_STANDARD 11)
|
|
SET_PROPERTY(TARGET wasm-shell PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
-INSTALL(TARGETS wasm-shell DESTINATION bin)
|
|
+INSTALL(TARGETS wasm-shell DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
SET(wasm-opt_SOURCES
|
|
src/tools/wasm-opt.cpp
|
|
@@ -164,7 +165,7 @@ ADD_EXECUTABLE(wasm-opt
|
|
TARGET_LINK_LIBRARIES(wasm-opt wasm asmjs emscripten-optimizer ${all_passes} ast support)
|
|
SET_PROPERTY(TARGET wasm-opt PROPERTY CXX_STANDARD 11)
|
|
SET_PROPERTY(TARGET wasm-opt PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
-INSTALL(TARGETS wasm-opt DESTINATION bin)
|
|
+INSTALL(TARGETS wasm-opt DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
SET(asm2wasm_SOURCES
|
|
src/tools/asm2wasm.cpp
|
|
@@ -175,7 +176,7 @@ ADD_EXECUTABLE(asm2wasm
|
|
TARGET_LINK_LIBRARIES(asm2wasm emscripten-optimizer ${all_passes} wasm asmjs ast support)
|
|
SET_PROPERTY(TARGET asm2wasm PROPERTY CXX_STANDARD 11)
|
|
SET_PROPERTY(TARGET asm2wasm PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
-INSTALL(TARGETS asm2wasm DESTINATION bin)
|
|
+INSTALL(TARGETS asm2wasm DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
SET(s2wasm_SOURCES
|
|
src/tools/s2wasm.cpp
|
|
@@ -187,7 +188,7 @@ ADD_EXECUTABLE(s2wasm
|
|
TARGET_LINK_LIBRARIES(s2wasm passes wasm asmjs ast support)
|
|
SET_PROPERTY(TARGET s2wasm PROPERTY CXX_STANDARD 11)
|
|
SET_PROPERTY(TARGET s2wasm PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
-INSTALL(TARGETS s2wasm DESTINATION bin)
|
|
+INSTALL(TARGETS s2wasm DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
SET(wasm_as_SOURCES
|
|
src/tools/wasm-as.cpp
|
|
@@ -197,7 +198,7 @@ ADD_EXECUTABLE(wasm-as
|
|
TARGET_LINK_LIBRARIES(wasm-as wasm asmjs passes ast support)
|
|
SET_PROPERTY(TARGET wasm-as PROPERTY CXX_STANDARD 11)
|
|
SET_PROPERTY(TARGET wasm-as PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
-INSTALL(TARGETS wasm-as DESTINATION bin)
|
|
+INSTALL(TARGETS wasm-as DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
SET(wasm_dis_SOURCES
|
|
src/tools/wasm-dis.cpp
|
|
@@ -207,4 +208,4 @@ ADD_EXECUTABLE(wasm-dis
|
|
TARGET_LINK_LIBRARIES(wasm-dis passes wasm asmjs ast support)
|
|
SET_PROPERTY(TARGET wasm-dis PROPERTY CXX_STANDARD 11)
|
|
SET_PROPERTY(TARGET wasm-dis PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
-INSTALL(TARGETS wasm-dis DESTINATION bin)
|
|
+INSTALL(TARGETS wasm-dis DESTINATION ${CMAKE_INSTALL_BINDIR})
|