Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of Visual Studio #75

Merged
merged 2 commits into from
Mar 17, 2024
Merged

Add support of Visual Studio #75

merged 2 commits into from
Mar 17, 2024

Conversation

vakomash
Copy link

No description provided.

@APN-Pucky
Copy link
Owner

I am testing it on linux in vscode with the integration, but gcc-13 complains about missing braces with the added if(tokenParsed). So it should be if(tokenParsed) { ... } :

[build] /usr/bin/g++-13 -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DBOOST_TIMER_DYN_LINK -DBOOST_TIMER_NO_LIB -DNQUEST -DTYRANT_OPTIMIZER_VERSION=\"\" -I/home/apn/git/tyrant_optimize/extern/hPMML/include -Wall -Werror -Ofast -g -std=gnu++14 -MD -MT CMakeFiles/tuo.dir/tyrant_optimize.cpp.o -MF CMakeFiles/tuo.dir/tyrant_optimize.cpp.o.d -o CMakeFiles/tuo.dir/tyrant_optimize.cpp.o -c /home/apn/git/tyrant_optimize/tyrant_optimize.cpp
[build] /home/apn/git/tyrant_optimize/tyrant_optimize.cpp: In function ‘DeckResults run(int, const char**)’:
[build] /home/apn/git/tyrant_optimize/tyrant_optimize.cpp:3270:12: error: suggest explicit braces to avoid ambiguous ‘else’ [-Werror=dangling-else]
[build]  3270 |         if (!tokenParsed)
[build]       |            ^
[build] cc1plus: all warnings being treated as errors
[build] ninja: build stopped: subcommand failed.
[proc] The command: /usr/bin/cmake --build /home/apn/git/tyrant_optimize/build --config Debug --target all -- exited with code: 1

CMakeLists.txt Outdated
if(STATIC)
set( BUILD_SHARED_LIBRARIES OFF)
set( BOOST_USE_STATIC_LIBS ON )
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to set that again

Suggested change
set( BOOST_USE_STATIC_LIBS ON )

CMakeLists.txt Outdated
@@ -30,7 +35,8 @@ if (OPENMP_FOUND)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
endif()
find_package(Boost EXACT COMPONENTS system thread filesystem regex timer REQUIRED)
find_package(Boost COMPONENTS system thread filesystem regex timer REQUIRED)
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
include_directories( ${Boost_INCLUDE_DIR} )

Minor change, but I'd keep all the cmake functions lowercase.

@@ -2530,6 +2536,8 @@ DeckResults run(int argc, const char **argv)

for (int argIndex = 3; argIndex < argc; ++argIndex)
{
//bypass MSVS issue: Nesting of code blocks exceeds the limit of 128 nesting levels
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, that is a weird error from msvc...

@APN-Pucky
Copy link
Owner

LGTM, thanks!

@APN-Pucky APN-Pucky merged commit 5fffbff into APN-Pucky:master Mar 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants