Skip to content

Commit

Permalink
Don't generate option-test, option-codegen-test and other targets…
Browse files Browse the repository at this point in the history
… when `OPTION_INSTALL` is `TRUE`
  • Loading branch information
NUCLEAR-BOMB committed Nov 15, 2024
1 parent 23f73d4 commit 95d71ed
Showing 1 changed file with 23 additions and 27 deletions.
50 changes: 23 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,29 @@ if (OPTION_USE_NATSTEPFILTER)
target_sources(option INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/debugger/option.natstepfilter>)
endif()

if (OPTION_INSTALL)
set(exclude_from_all EXCLUDE_FROM_ALL)
endif()

if (DEFINED OPTION_EXTRA_FLAGS)
separate_arguments(OPTION_EXTRA_FLAGS)
add_compile_options(${OPTION_EXTRA_FLAGS})
add_link_options(${OPTION_EXTRA_FLAGS})
endif()

if (OPTION_TEST)
add_subdirectory(test ${exclude_from_all})
endif()

if (OPTION_EXAMPLES)
add_subdirectory(examples ${exclude_from_all})
endif()

if (OPTION_BENCHMARK)
add_subdirectory(benchmark ${exclude_from_all})
endif()

if (OPTION_CODEGEN_TEST)
add_subdirectory(test/codegen ${exclude_from_all})
endif()

if (OPTION_INSTALL)
if (NOT OPTION_INSTALL)
if (DEFINED OPTION_EXTRA_FLAGS)
separate_arguments(OPTION_EXTRA_FLAGS)
add_compile_options(${OPTION_EXTRA_FLAGS})
add_link_options(${OPTION_EXTRA_FLAGS})
endif()

if (OPTION_TEST)
add_subdirectory(test ${exclude_from_all})
endif()

if (OPTION_EXAMPLES)
add_subdirectory(examples ${exclude_from_all})
endif()

if (OPTION_BENCHMARK)
add_subdirectory(benchmark ${exclude_from_all})
endif()

if (OPTION_CODEGEN_TEST)
add_subdirectory(test/codegen ${exclude_from_all})
endif()
else() # ^^^ NOT OPTION_INSTALL / vvv OPTION_INSTALL
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)

Expand Down

0 comments on commit 95d71ed

Please sign in to comment.