mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-09 16:50:01 -06:00
Tests: Add RunCMake.Emscripten case for a shared library
This commit is contained in:
6
Tests/RunCMake/Emscripten/C-lib-shared.cmake
Normal file
6
Tests/RunCMake/Emscripten/C-lib-shared.cmake
Normal file
@@ -0,0 +1,6 @@
|
||||
enable_language(C)
|
||||
add_library(emscripten-test-lib SHARED libmod.c)
|
||||
|
||||
add_executable(exec-lib-c module.c)
|
||||
target_compile_definitions(exec-lib-c PRIVATE __USE_LIBFUN)
|
||||
target_link_libraries(exec-lib-c PRIVATE emscripten-test-lib)
|
||||
@@ -57,6 +57,12 @@ foreach(_emscripten_toolchain IN LISTS _emscripten_toolchains)
|
||||
-DCMAKE_C_COMPILER=${c_comp}
|
||||
)
|
||||
|
||||
# Create a shared library and executable from .c sources.
|
||||
run_toolchain(C-lib-shared
|
||||
-DCMAKE_SYSTEM_NAME=Emscripten
|
||||
-DCMAKE_C_COMPILER=${c_comp}
|
||||
)
|
||||
|
||||
run_cmake_with_options(C-WHOLE_ARCHIVE
|
||||
-DCMAKE_SYSTEM_NAME=Emscripten
|
||||
-DCMAKE_C_COMPILER=${c_comp}
|
||||
|
||||
Reference in New Issue
Block a user