From 475f9025843cff9ac94781368280730d34aa0219 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Mon, 19 Jul 2021 00:27:34 +0200 Subject: [PATCH 1/2] Fix emscripten: Append CMAKE_MODULE_PATH instead of overwriting it Emscripten adds a custom CMAKE_MODULE_PATH in the toolchain file. Without these modules TestBigEndian fails. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0293363..64b33487 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ if(POLICY CMP0091) endif() project ( FluidSynth C CXX ) -set ( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_admin ) +list( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_admin ) # FluidSynth package name set ( PACKAGE "fluidsynth" ) From 0e3411cba4742543850a815d2e2d1ab48f1f54b7 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Mon, 19 Jul 2021 00:36:31 +0200 Subject: [PATCH 2/2] Emscripten: --as-needed is not supported --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64b33487..144b16e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,12 +200,12 @@ unset ( FLUID_LIBS CACHE ) unset ( ENABLE_UBSAN CACHE ) if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "Intel" ) - if ( NOT APPLE AND NOT OS2 ) + if ( NOT APPLE AND NOT OS2 AND NOT EMSCRIPTEN ) set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed" ) set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) - endif ( NOT APPLE AND NOT OS2 ) + endif ( NOT APPLE AND NOT OS2 AND NOT EMSCRIPTEN ) # define some warning flags set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement -Werror=implicit-function-declaration" )