Skip to content

Commit

Permalink
Avoid add_compile_options in the toolchain file (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSchofield committed Jul 14, 2023
2 parents abcef3e + f114fd5 commit 05449d3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Windows.MSVC.toolchain.cmake
Expand Up @@ -197,8 +197,8 @@ link_directories("${VS_TOOLSET_PATH}/lib/x86/store/references")

# Module support
if(VS_EXPERIMENTAL_MODULE)
add_compile_options(/experimental:module)
add_compile_options(/stdIfcDir "${VS_TOOLSET_PATH}/ifc/${CMAKE_VS_PLATFORM_TOOLSET_ARCHITECTURE}")
set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} /experimental:module")
set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} /stdIfcDir \"${VS_TOOLSET_PATH}/ifc/${CMAKE_VS_PLATFORM_TOOLSET_ARCHITECTURE}\"")
endif()

# Windows Kits
Expand Down
1 change: 1 addition & 0 deletions example/CMakeLists.txt
Expand Up @@ -11,6 +11,7 @@ add_compile_definitions(
)

add_subdirectory(CommandLine)
add_subdirectory(CommandLineC)
add_subdirectory(SharedLibrary)
add_subdirectory(WindowsApplication)

Expand Down
9 changes: 9 additions & 0 deletions example/CommandLineC/CMakeLists.txt
@@ -0,0 +1,9 @@
#----------------------------------------------------------------------------------------------------------------------
#
#----------------------------------------------------------------------------------------------------------------------
project(CommandLineC LANGUAGES C)

add_executable(CommandLineC
main.c
)

6 changes: 6 additions & 0 deletions example/CommandLineC/main.c
@@ -0,0 +1,6 @@
#include <stdio.h>

int main(int argc, char* argv[])
{
printf("Hello, World!");
}

0 comments on commit 05449d3

Please sign in to comment.