File tree Expand file tree Collapse file tree 2 files changed +152
-124
lines changed Expand file tree Collapse file tree 2 files changed +152
-124
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ set(ZIP_SRC thirdparty/zip/src)
99
1010option (LIBSCRATCHCPP_BUILD_UNIT_TESTS "Build unit tests" ON )
1111option (LIBSCRATCHCPP_NETWORK_SUPPORT "Support for downloading projects" ON )
12+ option (LIBSCRATCHCPP_COMPUTED_GOTO "Support for computed goto" ON )
13+
14+ if (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ))
15+ # Computed goto not supported on anything except GCC
16+ set (LIBSCRATCHCPP_COMPUTED_GOTO OFF CACHE BOOL "" FORCE)
17+ endif ()
1218
1319find_package (nlohmann_json 3.9.1 REQUIRED)
1420find_package (utf8cpp REQUIRED)
@@ -18,6 +24,10 @@ add_subdirectory(src)
1824include_directories (src) # TODO: Remove this line
1925include_directories (include )
2026
27+ if (LIBSCRATCHCPP_COMPUTED_GOTO)
28+ target_compile_definitions (scratchcpp PRIVATE ENABLE_COMPUTED_GOTO)
29+ endif ()
30+
2131target_sources (scratchcpp
2232 PUBLIC
2333 include /scratchcpp/global .h
You can’t perform that action at this time.
0 commit comments