diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b395a8..171aac1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,8 +251,11 @@ if (XEUS_NELSON_BUILD_STATIC) else () xnelson_create_target(xeus-nelson-static STATIC xeus-nelson) endif () + if (XEUS_NELSON_EMSCRIPTEN_WASM_BUILD) + target_compile_options(xeus-nelson-static PRIVATE -fPIC) + endif () list(APPEND XEUS_NELSON_TARGETS xeus-nelson-static) - + endif () # xnelson @@ -273,6 +276,7 @@ if (XEUS_NELSON_EMSCRIPTEN_WASM_BUILD) add_executable(xnelson_wasm src/main_emscripten_kernel.cpp) target_link_libraries(xnelson_wasm PRIVATE xeus-lite) target_compile_features(xnelson_wasm PRIVATE cxx_std_17) + target_compile_options(xnelson_wasm PRIVATE -fPIC) xnelson_set_kernel_options(xnelson_wasm) xeus_wasm_compile_options(xnelson_wasm) xeus_wasm_link_options(xnelson_wasm "web,worker")