diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-08-28 15:02:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-08-28 13:23:59 +0000 |
commit | db617705668841f1db21330c14f829c42e640f30 (patch) | |
tree | 128131e47c4aa3d1569e1fc4dc31d598d4446f82 /cmake/QtBuild.cmake | |
parent | 4e5fc66c04bddfc8a62e978716b0b57e9e468aaf (diff) |
Fix CMake errors around linker flags when targeting WASM
* The -no-undefined linker option only makes sense for shared
libraries. The WASM build is a static build though.
* The -gc-sections linker option is only relevant for host tools
and certainly applicable to the WASM toolchain.
Change-Id: Ib8daec66a6d80f5025887448882dd891e6176268
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 3370cb7e6b..cc5fe5e07d 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -688,6 +688,9 @@ endmacro() function(qt_internal_add_link_flags_no_undefined target) + if (NOT QT_BUILD_SHARED_LIBS) + return() + endif() if (GCC OR CLANG) if(APPLE) set(no_undefined_flag "-Wl,-undefined,error") @@ -707,7 +710,7 @@ function(qt_internal_add_link_flags_gc_sections target visibility) message(FATAL_ERROR "Visibitily setting must be one of PRIVATE, INTERFACE or PUBLIC.") endif() - if (GCC OR CLANG) + if ((GCC OR CLANG) AND NOT EMSCRIPTEN) if(APPLE) set(gc_sections_flag "-Wl,-dead_strip") elseif(LINUX OR BSD OR SOLARIS OR WIN32 OR ANDROID) |