Browse Source

Adjust C++20 modules poc for MSVC compiler

Patrick-Christopher Mattulat 2 weeks ago
parent
commit
b9048c7da0

+ 13 - 3
CMakeLists.txt

@@ -153,12 +153,12 @@ message("${PROJECT_NAME}: Adding additional cmake dependencies...")
 if (${LS_STD_BUILD_WITH_TESTS})
     add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/test/lib/${GOOGLE_TEST_MODULE})
 
-    target_compile_options(gtest PRIVATE -Wno-error -Wno-character-conversion)
-    target_compile_options(gmock PRIVATE -Wno-error -Wno-character-conversion)
-
     if (APPLE AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
         message("${PROJECT_NAME}: Set Google Test Apple SDK with LLVM Clang...")
 
+        target_compile_options(gtest PRIVATE -Wno-error -Wno-character-conversion)
+        target_compile_options(gmock PRIVATE -Wno-error -Wno-character-conversion)
+
         target_compile_options(gtest PRIVATE ${SDK_LIBCXX_FLAGS})
         target_compile_options(gmock PRIVATE ${SDK_LIBCXX_FLAGS})
     endif ()
@@ -262,6 +262,8 @@ endif ()
 if (${LS_STD_BUILD_WITH_TESTS})
     message("${MODULE_NAME_BOXING}: Building unit tests...")
     add_executable(${MODULE_NAME_BOXING}-unit-test ${UNIT_TEST_FILES_BOXING})
+
+    target_compile_features("${MODULE_NAME_BOXING}-unit-test" PUBLIC cxx_std_20)
 endif ()
 
 ##########################################################
@@ -335,6 +337,8 @@ if (${LS_STD_BUILD_WITH_TESTS})
                 ${UNIT_TEST_FILES_IO}
                 ${UNIT_TEST_FILES_SERIALIZATION}
                 ${UNIT_TEST_FILES_TIME})
+
+        target_compile_features("${PROJECT_NAME}-unit-test" PUBLIC cxx_std_20)
     else ()
         message("${PROJECT_NAME}: Building unit tests...")
         add_executable(${PROJECT_NAME}-unit-test
@@ -347,6 +351,8 @@ if (${LS_STD_BUILD_WITH_TESTS})
                 ${UNIT_TEST_FILES_IO}
                 ${UNIT_TEST_FILES_SERIALIZATION}
                 ${UNIT_TEST_FILES_TIME})
+
+        target_compile_features("${PROJECT_NAME}-unit-test" PUBLIC cxx_std_20)
     endif ()
 endif ()
 
@@ -406,6 +412,8 @@ if (${LS_STD_BUILD_WITH_TESTS})
                 ${INTEGRATION_TEST_FILES_IO}
                 ${UNIT_TEST_FILES_SERIALIZATION}
                 ${UNIT_TEST_FILES_TIME})
+
+        target_compile_features("${PROJECT_NAME}-test" PUBLIC cxx_std_20)
     else ()
         message("${PROJECT_NAME}: Building all tests with JNI support...")
         add_executable(${PROJECT_NAME}-test
@@ -419,6 +427,8 @@ if (${LS_STD_BUILD_WITH_TESTS})
                 ${INTEGRATION_TEST_FILES_IO}
                 ${UNIT_TEST_FILES_SERIALIZATION}
                 ${UNIT_TEST_FILES_TIME})
+
+        target_compile_features("${PROJECT_NAME}-test" PUBLIC cxx_std_20)
     endif ()
 endif ()
 

+ 2 - 1
include/ls-std/io/section-pair/model/SectionPairRowListValue.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-10
-* Changed:         2024-09-13
+* Changed:         2025-12-24
 *
 * */
 
@@ -15,6 +15,7 @@
 #include <ls-std/core/Class.hpp>
 #include <ls-std/io/section-pair/SectionPairTypes.hpp>
 #include <ls-std/os/dynamic-goal.hpp>
+#include <memory>
 
 /*
  * @doc: class(name: 'SectionPairRowListValue', package: 'io')

+ 2 - 1
source/ls-std/boxing/Boolean.cppm

@@ -13,6 +13,7 @@ module;
 #include <ls-std/core/Class.hpp>
 #include <ls-std/core/interface/IBoxing.hpp>
 #include <ls-std/core/exception/IllegalArgumentException.hpp>
+#include <ls-std/os/dynamic-goal.hpp>
 #include <string>
 
 export module ls.std.boxing.boolean;
@@ -25,7 +26,7 @@ using std::transform;
 
 export namespace ls::std::boxing
 {
-  class Boolean : public Class, public IBoxing
+  class LS_STD_DYNAMIC_GOAL Boolean : public Class, public IBoxing
   {
     public:
 

+ 2 - 1
source/ls-std/io/section-pair/model/SectionPairDocument.cpp

@@ -3,10 +3,11 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-15
-* Changed:         2025-12-21
+* Changed:         2025-12-24
 *
 * */
 
+#include <algorithm>
 #include <ls-std/core/ConditionalFunctionExecutor.hpp>
 #include <ls-std/core/evaluator/IndexOutOfBoundsEvaluator.hpp>
 #include <ls-std/core/evaluator/NullPointerArgumentEvaluator.hpp>

+ 2 - 1
source/ls-std/io/section-pair/model/SectionPairSection.cpp

@@ -3,10 +3,11 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-13
-* Changed:         2025-12-21
+* Changed:         2025-12-24
 *
 * */
 
+#include <algorithm>
 #include <ls-std/core/ConditionalFunctionExecutor.hpp>
 #include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
 #include <ls-std/core/evaluator/IndexOutOfBoundsEvaluator.hpp>

+ 3 - 3
test/cases/boxing/BooleanTest.cpp

@@ -7,10 +7,10 @@
  *
  * */
 
-import ls.std.boxing.boolean;
-
-#include <gtest/gtest.h>
 #include <ls-std/ls-std-core.hpp>
+#include <gtest/gtest.h>
+
+import ls.std.boxing.boolean;
 
 using ls::std::boxing::Boolean;
 using ls::std::core::IllegalArgumentException;