38bd467137fd — Vesa Norilo 5 months ago
fix binaryen include dir
1 files changed, 5 insertions(+), 6 deletions(-)

M cmake/Binaryen.cmake
M cmake/Binaryen.cmake +5 -6
@@ 1,8 1,9 @@ 
 set(CMAKE_FIND_ROOT_PATH "")
 set(CMAKE_POSITION_INDEPENDENT_CODE False)
 
-set_property(DIRECTORY PROPERTY EP_BASE "${CMAKE_BINARY_DIR}/external")
-set(BINARYEN_BUILD_DIR "${CMAKE_BINARY_DIR}/external/Build/binaryen")
+set(EXT_BASE "${CMAKE_BINARY_DIR}/external")
+set_property(DIRECTORY PROPERTY EP_BASE ${EXT_BASE})
+set(BINARYEN_BUILD_DIR "${EXT_BASE}/Build/binaryen")
 
 include(ExternalProject)
 

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

          
@@ 58,11 59,9 @@ add_library(binaryen_backend
 	"src/backends/GenericModule.h"
 	"src/backends/CodeGenModule.h")
 
-include_directories("${BINARYEN_DIR}/src")
-	
 target_link_libraries(binaryen_backend PUBLIC ${BINARYEN_LIBRARIES})
 set_target_properties( binaryen_backend PROPERTIES FOLDER libs/emitters )
-target_include_directories( binaryen_backend PRIVATE ${BINARYEN_INCLUDE_DIR} )
+target_include_directories( binaryen_backend PRIVATE "${EXT_BASE}/Source/binaryen/src" )
 add_dependencies(binaryen_backend binaryen)
 
 set(HAVE_BINARYEN True)