diff --git a/CMakeLists.txt b/CMakeLists.txt index d04353e..19724f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,8 @@ if (${IS_GNU} OR ${IS_CLANG}) endif() if (NOT DEFINED EMSCRIPTEN) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong -fstack-clash-protection") + else() + set(CMAKE_EXE_LINKER_FLAGS "--closure 1 -sWASM=0 --memory-init-file 0 -sEXPORTED_FUNCTIONS=_main ${CMAKE_EXE_LINKER_FLAGS}") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstrict-enums -pipe -funwind-tables -fasynchronous-unwind-tables -frtti -fexceptions") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize -fno-math-errno") diff --git a/Jenkinsfile b/Jenkinsfile index 73a5c75..cd3f403 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ pipeline { buildTarget('x86_64-linux-gnu', 'x86_64', 'amd64') buildTarget('i686-linux-gnu', 'i386', 'i386') cmakeBuild buildDir: "cmake-build-release-emscripten", buildType: 'release', cleanBuild: true, installation: 'Latest', - cmakeArgs: "-DCMAKE_TOOLCHAIN_FILE=\"/usr/share/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake\" -DCMAKE_EXE_LINKER_FLAGS=\"--closure 1 -sWASM=0 --memory-init-file 0\" ${no_compilation_cache_flags()}", + cmakeArgs: "-DCMAKE_TOOLCHAIN_FILE=\"/usr/share/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake\" ${no_compilation_cache_flags()}", generator: cmake_generator() cmake arguments: "--build ./cmake-build-release-emscripten", installation: 'Latest' }