Disable LLVM warnings and enable LTO in emscripten build (#487)

Fixed #148 and last task of #156
This commit is contained in:
kvpanch authored and GitHub committed 2026-03-04 09:41:38 -05:00
1 parent 0c8ef107f3
commit 5aebcc76ab
1 file changed
+3 -4
@@ -91,6 +91,7 @@ fn build_host(
target_directory.to_string_lossy()
),
"-DLLVM_BUILD_SHARED_LIBS='Off'",
"-DLLVM_ENABLE_WARNINGS='Off'",
"-DCMAKE_BUILD_TYPE='Release'",
&format!(
"-DLLVM_TARGETS_TO_BUILD='WebAssembly;{}'",
@@ -152,10 +153,8 @@ fn build_target(
"Ninja",
"-DLINKER_SUPPORTS_COLOR_DIAGNOSTICS=0",
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=1",
// Enable thin LTO but emscripten has various issues with it.
// FIXME: https://github.com/paritytech/revive/issues/148
//"-DLLVM_ENABLE_LTO='Thin'",
//"-DCMAKE_EXE_LINKER_FLAGS='-Wl,-u,htons -Wl,-u,htonl -Wl,-u,fileno -Wl,-u,ntohs'",
"-DLLVM_ENABLE_LTO='Thin'",
"-DCMAKE_EXE_LINKER_FLAGS='-Wl,-u,htons -Wl,-u,htonl -Wl,-u,fileno -Wl,-u,ntohs'",
&format!(
"-DCMAKE_INSTALL_PREFIX='{}'",
target_directory.to_string_lossy()