Skip to content

Commit

Permalink
fix compilation on threaded webassembly
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-ce committed Nov 14, 2023
1 parent 0ddc6c9 commit 7dc404b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL Network Quick QuickControls
if (ALP_ENABLE_POSITIONING)
find_package(Qt6 REQUIRED COMPONENTS Positioning)
endif()
if (ALP_UNITTESTS)
find_package(Qt6 REQUIRED COMPONENTS Test)
endif()

include(FetchContent)
FetchContent_Declare(alpine_height_data
Expand All @@ -80,6 +77,7 @@ FetchContent_Declare(alpineapp_fonts
URL_HASH MD5=681612d5ad33731c512ce056d2ca2297
SOURCE_DIR ${CMAKE_SOURCE_DIR}/${ALP_EXTERN_DIR}/alpineapp_fonts
)

FetchContent_MakeAvailable(alpine_height_data alpineapp_fonts)

if (ANDROID)
Expand All @@ -92,19 +90,23 @@ if (ANDROID)
include(${android_openssl_SOURCE_DIR}/android_openssl.cmake)
endif()



########################################### projects #################################################
add_subdirectory(nucleus)
add_subdirectory(gl_engine)
add_subdirectory(plain_renderer)
add_subdirectory(app)

if (ALP_UNITTESTS)
find_package(Qt6 REQUIRED COMPONENTS Test)
FetchContent_Declare(catch2
DOWNLOAD_EXTRACT_TIMESTAMP true
URL https://github.com/catchorg/Catch2/archive/refs/tags/v3.4.0.tar.gz
URL_HASH MD5=2c802a4938ed842e2942c60d1d231bb7
SOURCE_DIR ${CMAKE_SOURCE_DIR}/extern/Catch2
)
FetchContent_MakeAvailable(catch2)
if (EMSCRIPTEN AND ALP_ENABLE_THREADING)
target_compile_options(Catch2 PRIVATE -pthread)
endif()

function(alp_setup_unittest)
if (ANDROID)
install(TARGETS ${ARGV0}
Expand Down
8 changes: 0 additions & 8 deletions unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
cmake_minimum_required(VERSION 3.24)
project(alpine-renderer-unittests_nucleus LANGUAGES CXX)

FetchContent_Declare(catch2
DOWNLOAD_EXTRACT_TIMESTAMP true
URL https://github.com/catchorg/Catch2/archive/refs/tags/v3.4.0.tar.gz
URL_HASH MD5=2c802a4938ed842e2942c60d1d231bb7
SOURCE_DIR ${CMAKE_SOURCE_DIR}/extern/Catch2
)
FetchContent_MakeAvailable(catch2)

qt_add_executable(unittests_nucleus
main.cpp
catch2_helpers.h
Expand Down
8 changes: 0 additions & 8 deletions unittests_gl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
cmake_minimum_required(VERSION 3.24)
project(alpine-renderer-unittests_gl_engine LANGUAGES CXX)

FetchContent_Declare(catch2
DOWNLOAD_EXTRACT_TIMESTAMP true
URL https://github.com/catchorg/Catch2/archive/refs/tags/v3.4.0.tar.gz
URL_HASH MD5=2c802a4938ed842e2942c60d1d231bb7
SOURCE_DIR ${CMAKE_SOURCE_DIR}/extern/Catch2
)
FetchContent_MakeAvailable(catch2)

qt_add_executable(unittests_gl_engine
UnittestGlWindow.h UnittestGlWindow.cpp
main.cpp
Expand Down

0 comments on commit 7dc404b

Please sign in to comment.