Bläddra i källkod

build: prepare for tools and testbed

Michele Caini 1 år sedan
förälder
incheckning
b9850320c1
3 ändrade filer med 29 tillägg och 36 borttagningar
  1. 29 35
      CMakeLists.txt
  2. 0 1
      tools/CMakeLists.txt
  3. 0 0
      tools/editor/CMakeLists.txt

+ 29 - 35
CMakeLists.txt

@@ -81,20 +81,6 @@ endif()
 
 # Add EnTT target
 
-option(ENTT_INCLUDE_HEADERS "Add all EnTT headers to the EnTT target." OFF)
-option(ENTT_INCLUDE_NATVIS "Add EnTT natvis files to the EnTT target." OFF)
-
-if(ENTT_INCLUDE_NATVIS)
-    if(MSVC)
-        set(ENTT_HAS_NATVIS TRUE CACHE BOOL "" FORCE)
-        mark_as_advanced(ENTT_HAS_NATVIS)
-    endif()
-
-    if(NOT ENTT_HAS_NATVIS)
-        message(VERBOSE "The option ENTT_INCLUDE_NATVIS is set but natvis files are not supported. They will not be added to the target.")
-    endif()
-endif()
-
 include(GNUInstallDirs)
 
 add_library(EnTT INTERFACE)
@@ -109,6 +95,35 @@ target_include_directories(
 
 target_compile_features(EnTT INTERFACE cxx_std_17)
 
+if(ENTT_HAS_LIBCPP)
+    target_compile_options(EnTT BEFORE INTERFACE -stdlib=libc++)
+endif()
+
+if(ENTT_HAS_SANITIZER)
+    target_compile_options(EnTT INTERFACE $<$<CONFIG:Debug>:-fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined>)
+    target_link_libraries(EnTT INTERFACE $<$<CONFIG:Debug>:-fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined>)
+endif()
+
+if(ENTT_CLANG_TIDY_EXECUTABLE)
+    set(CMAKE_CXX_CLANG_TIDY "${ENTT_CLANG_TIDY_EXECUTABLE};--config-file=${EnTT_SOURCE_DIR}/.clang-tidy;--header-filter=${EnTT_SOURCE_DIR}/src/entt/.*")
+endif()
+
+# Add EnTT goodies
+
+option(ENTT_INCLUDE_HEADERS "Add all EnTT headers to the EnTT target." OFF)
+option(ENTT_INCLUDE_NATVIS "Add EnTT natvis files to the EnTT target." OFF)
+
+if(ENTT_INCLUDE_NATVIS)
+    if(MSVC)
+        set(ENTT_HAS_NATVIS TRUE CACHE BOOL "" FORCE)
+        mark_as_advanced(ENTT_HAS_NATVIS)
+    endif()
+
+    if(NOT ENTT_HAS_NATVIS)
+        message(VERBOSE "The option ENTT_INCLUDE_NATVIS is set but natvis files are not supported. They will not be added to the target.")
+    endif()
+endif()
+
 if(ENTT_INCLUDE_HEADERS)
     target_sources(
         EnTT
@@ -209,19 +224,6 @@ if(ENTT_HAS_NATVIS)
     )
 endif()
 
-if(ENTT_HAS_SANITIZER)
-    target_compile_options(EnTT INTERFACE $<$<CONFIG:Debug>:-fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined>)
-    target_link_libraries(EnTT INTERFACE $<$<CONFIG:Debug>:-fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined>)
-endif()
-
-if(ENTT_CLANG_TIDY_EXECUTABLE)
-    set(CMAKE_CXX_CLANG_TIDY "${ENTT_CLANG_TIDY_EXECUTABLE};--config-file=${EnTT_SOURCE_DIR}/.clang-tidy;--header-filter=${EnTT_SOURCE_DIR}/src/entt/.*")
-endif()
-
-if(ENTT_HAS_LIBCPP)
-    target_compile_options(EnTT BEFORE INTERFACE -stdlib=libc++)
-endif()
-
 # Install EnTT and all related files
 
 option(ENTT_INSTALL "Install EnTT and all related files." OFF)
@@ -318,14 +320,6 @@ if(ENTT_BUILD_TESTING)
     add_subdirectory(test)
 endif()
 
-# Tools
-
-option(ENTT_BUILD_TOOLS "Enable building tools." OFF)
-
-if(ENTT_BUILD_TOOLS)
-    add_subdirectory(tools)
-endif()
-
 # Documentation
 
 option(ENTT_BUILD_DOCS "Enable building with documentation." OFF)

+ 0 - 1
tools/CMakeLists.txt

@@ -1 +0,0 @@
-add_subdirectory(editor)

+ 0 - 0
tools/editor/CMakeLists.txt